alokp99 Posted July 25, 2008 Share Posted July 25, 2008 I have a very basic question.When I create a class will it be visible in different files? I have class a in one file and class b in another.I tried to use functions defined in class a by instantiating class a but got an error saying class a could not be found.I am not sure what needs to be done? Thanks, Alok. Link to comment https://forums.phpfreaks.com/topic/116647-class-scope/ Share on other sites More sharing options...
jonsjava Posted July 25, 2008 Share Posted July 25, 2008 include the class file. Lets say the class is in a file named "image.class.php": <?php include("image.class.php"); Link to comment https://forums.phpfreaks.com/topic/116647-class-scope/#findComment-599754 Share on other sites More sharing options...
discomatt Posted July 25, 2008 Share Posted July 25, 2008 See include(), require(), and the __autoload() function http://php.net/__autoload Link to comment https://forums.phpfreaks.com/topic/116647-class-scope/#findComment-599756 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.