hishighness Posted May 8, 2009 Share Posted May 8, 2009 Hey everyone, I'm trying to teach myself php by reading php.net and diving in to code head first. It's going pretty well so far as I've been able to meet some useful stuff but I've kinda reached a roadblock here and was wondering if you guys can "unstuck" me. For the life of me I can't figure out what this is supposed to do. if($ipsclass->input['act'] == "Arcade") { $ipsclass->input['autocom'] = "arcade"; } From the context of what the page does I deduce that it checks to see whether act = Arcade and if it is it sets $ipsclass->input['autocom'] to "arcade" but I have no clue what the $ipsclass->input part does. Is it like a function called "input" ? Is $ipsclass a variable, a function, or something else I've never heard of? Any light that could be shed on this would be appreciated, because I'm lost. It looks like a powerful function which could save me a lot of typing. Thanks for your time, H² Link to comment https://forums.phpfreaks.com/topic/157411-help-with-learning/ Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 ipsclass is a class. Shocking isn't it. But it's a class and it's calling on an input array that's in the class. A class is *NOT* a function. Link to comment https://forums.phpfreaks.com/topic/157411-help-with-learning/#findComment-829815 Share on other sites More sharing options...
allworknoplay Posted May 8, 2009 Share Posted May 8, 2009 if($ipsclass->input['act'] == "Arcade") { $ipsclass->input['autocom'] = "arcade"; } $ipsclass is your object. So somewhere up above you instantiated it like so: $ipsclass = new yourclass(); You access your entire class through $ipsclass....any methods or properties is accessed through this.... Link to comment https://forums.phpfreaks.com/topic/157411-help-with-learning/#findComment-829853 Share on other sites More sharing options...
hishighness Posted May 9, 2009 Author Share Posted May 9, 2009 Thank you allworkandnoplay, that was very helpful. Link to comment https://forums.phpfreaks.com/topic/157411-help-with-learning/#findComment-830265 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.