PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hey guys, I tried googling it, but google wouldn't accept the string "->" so i couldn't find out without asking.
What is the sign -> in php?
For example:
$logger->_log('You are not logged in; return to index.php');
What does the arrow do?
Thanks!
Yuval
$this is a variable. Hence the lovely dollar sign, showing people that PHP should be equivalent to money. Yes.
echo "$".number_format($myCash, 2, '.', ',');
That number could be big... I'm off track.
But yeah, $this is representative of a class variable when used in the statement $this->variable;
$this would have been declared a class in such a way that classes are declared in all OO languages... $this = new classConstructor()
OR it's in the class. "$this->" is like "this."... I'm sure you shouldn't have a reason to name a variable "$this".... Silly me
Well, except C++.. but online, C++ just served as a way to make me learn PHP 15 times faster
Last edited by superdezign on Tue Jan 30, 2007 8:20 pm, edited 1 time in total.
Interesting reply! =)
lol, so this is defined by the class as new classConstructor(), then it is being used to access the class?
I think i'm confused, why would someone want to use $this?