|
Posted by Treefrog on 05/11/06 10:53
fatbeaver wrote:
> hi guys, i just started learning php, and am qurious what the arrow
> sign operator mean..
> for ex:
>
> $this->dbConnect();
>
>
> can someone explain it to me?
Ignore it. Learn PHP first, then worry about that one.
It's a whole different way of programming, but unless you know the
language very well in the first place, it will just make things more
confusing.
However, to satisfy the question the -> is referring to a method or
member of a class.
Basically; You can code in objects, which is in very simple terms,
where everything is like a real life object.
e.g. imagine a person object. A person has a name, age, hair colour
etc, so if you had written a person "class" you would use it in you
code with the -> operator. Like...
$someChap = new person(); // set the variable $someChap to be a person
object.
$someChap->name = "Bob";
Anyway, as I said, learn PHP properly first, then worry about all this
stuff. It will make you a better programmer, in my opinion.
Good luck and enjoy it.
Nathan
[Back to original message]
|