KevinM1 Posted November 8, 2006 Share Posted November 8, 2006 I've read that a lot of people use the __autoload() function to dynamically include whatever class files are needed. I'm just wondering if I'm understanding how that's done:You put your defined __autoload() function inside of a file that's included in every other page (like a config file), right? And the definition would be something along the lines of the following code, correct?[code]<?phpfunction __autoload($className){ include ("../classes/{$className}.php");}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/26590-quick-__autoload-question/ Share on other sites More sharing options...
Daniel0 Posted November 8, 2006 Share Posted November 8, 2006 Yeah. But you need PHP5. Quote Link to comment https://forums.phpfreaks.com/topic/26590-quick-__autoload-question/#findComment-121724 Share on other sites More sharing options...
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.