Biske94 Posted February 15, 2018 Report Posted February 15, 2018 Hi people! Since I couldnt get answers from Stackoverflow I desiced to ask you. Can someone explain how does these 2 functions work: class_exists() spl_autoload_register() Class exist function if(class_exists('User')){ echo "It does exists"; } class User { /* Some code here */ } // the output of file is "It does exists" So how does this function works? Scans whole file? Whole directory? I mean its called before I defined class. Spl autoload register function include 'functions.php'; // <- file where is the function class_exist('User') and spl_autoload_register() include 'db_config.php'; include 'database.php'; include 'user.php'; // <- Here is the class (User) So how does this function work? Its before any of those files that are included, and still it does it work? Does it scans whole directory where it is or what? I am really confused. Thanks peeps! Quote
administrator Posted February 25, 2018 Report Posted February 25, 2018 In the include files, is your class code. It is basically like pasting the code into your PHP page. Makes sense? 1 Quote
Guest Joseppi83 Posted September 19, 2018 Report Posted September 19, 2018 Similar to the following line in connected css files: @import "services.css"; @import "blog-section.css"; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.