golem Posted November 23, 2006 Share Posted November 23, 2006 hi,new to php. what is "->" means in php?examples:if($form->num_errors > 0){ echo "?";}andif($session->logged_in){ echo "x?";{thanks Quote Link to comment https://forums.phpfreaks.com/topic/28197-what-is/ Share on other sites More sharing options...
fert Posted November 23, 2006 Share Posted November 23, 2006 It's used to access things in a classexample:[code]class class_name{$number=5;$foo=6;$bar="hello";function bar(){echo $this->number;echo $this->foo;echo $this->bar;}}$thingy=new class_name;echo $thingy->number; // will output 5echo $thingy->foo; //will output 6echo $thingy->bar; //will output 'hello'$thingy->bar(); will output the same thing as above[/code] Quote Link to comment https://forums.phpfreaks.com/topic/28197-what-is/#findComment-128977 Share on other sites More sharing options...
golem Posted November 23, 2006 Author Share Posted November 23, 2006 Thanks mate! :-* Quote Link to comment https://forums.phpfreaks.com/topic/28197-what-is/#findComment-128988 Share on other sites More sharing options...
JasonLewis Posted November 23, 2006 Share Posted November 23, 2006 i think a mod or something should make a sticky thread because this question has been asked a lot lately. Quote Link to comment https://forums.phpfreaks.com/topic/28197-what-is/#findComment-128989 Share on other sites More sharing options...
wildteen88 Posted November 23, 2006 Share Posted November 23, 2006 [quote author=ProjectFear link=topic=116002.msg472476#msg472476 date=1164262621]i think a mod or something should make a sticky thread because this question has been asked a lot lately.[/quote]There is an FAQ thread in the [url=http://=http://www.phpfreaks.com/forums/index.php/board,41.0.html]FAQ/Code Snippet Repository]=http://www.phpfreaks.com/forums/index.php/board,41.0.html]FAQ/Code Snippet Repository[/url] forum made by me. Quote Link to comment https://forums.phpfreaks.com/topic/28197-what-is/#findComment-129211 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.