four4swords Posted May 31, 2008 Share Posted May 31, 2008 hey, How do i use a function inside a class? Normally i would just use "functionhere()" and that'll work.. but i guess you'll need a bit for if your referring to them in classes.. How do i use functions in classes? thanks Link to comment https://forums.phpfreaks.com/topic/108093-how-do-i-use-functions-in-classes/ Share on other sites More sharing options...
awpti Posted May 31, 2008 Share Posted May 31, 2008 $class = new Classname; //instantiate the class $class->function(); //call the method defined within the class I'd suggest reading more about Object Oriented Programming in PHP or an OOP subject in general. Link to comment https://forums.phpfreaks.com/topic/108093-how-do-i-use-functions-in-classes/#findComment-554045 Share on other sites More sharing options...
four4swords Posted May 31, 2008 Author Share Posted May 31, 2008 Thanks! lol I ended up with something like that.. but i didn't put in the arrow.. lol It's working fine now! Thanks! Link to comment https://forums.phpfreaks.com/topic/108093-how-do-i-use-functions-in-classes/#findComment-554046 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.