sambib Posted September 24, 2006 Share Posted September 24, 2006 [b]$CFG->[/b]wwwroot = 'http://site.local';i can't find -> anywhere in my two php books or online to tell me what this piece of code is doing...I'll take a guess that it's seeting a variable to 'http://site.local' but don't really understand why the -> is used or what it's there for...?thanks Link to comment https://forums.phpfreaks.com/topic/21903-explain-this-small-piece-of-php-code-please/ Share on other sites More sharing options...
Barand Posted September 24, 2006 Share Posted September 24, 2006 You are reading the wrong books. Try the php manualhttp://www.php.net/manual/en/language.oop.php Link to comment https://forums.phpfreaks.com/topic/21903-explain-this-small-piece-of-php-code-please/#findComment-97839 Share on other sites More sharing options...
yonta Posted September 24, 2006 Share Posted September 24, 2006 That has to do with object-oriented coding. An object is mainly a name for an instance of a class.In this case, $CFG is an object that has a property ('wwwroot'), and this property is being set to 'http://site.local' .Somewhere in your script(s) there's probably a '$CFG = new NameofClass();' line. Find it and then check the class.For a better understanding, google php oop tutorial and read some or check here [url=http://www.phpfreaks.com/tutorials/48/0.php]http://www.phpfreaks.com/tutorials/48/0.php [/url] Link to comment https://forums.phpfreaks.com/topic/21903-explain-this-small-piece-of-php-code-please/#findComment-97840 Share on other sites More sharing options...
sambib Posted September 25, 2006 Author Share Posted September 25, 2006 thanks guys, just what I wanted....! Link to comment https://forums.phpfreaks.com/topic/21903-explain-this-small-piece-of-php-code-please/#findComment-97849 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.