470,870 Members | 1,398 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

newb question

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?
thanks.

May 10 '06 #1
3 1122
Rik
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?


In short:
It calls a method or variable from an object.
Reading material:
http://www.php.net/manual/en/language.oop.php
http://www.php.net/manual/en/language.oop5.php

Grtz,
--
Rik Wasmus
May 10 '06 #2
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?
thanks.


You must really be new to programming in general.

The "->" notation is used to reference a method or a variable off of an
object. It's all about Object-Oriented Programming.

There are many good books and references on the subject of OOP. I suggest
you avail yourself of them.

--
-- Edmond Dantes, CMC
And Now for something Completely Different:
http://nailer.SlamItYourself.com
http://occupational.CraftyMen.com
http://running-shorts.internet66.com
http://sphynx.KindPets.com
http://grooves.SlamItYourself.com
http://kitchen-counter.ideas4yourhome.com
http://candles.WeddingJoyBells.com
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
May 11 '06 #3
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

May 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by claudel | last post: by
reply views Thread by David E. | last post: by
3 posts views Thread by Walter | last post: by
3 posts views Thread by claudel | last post: by
6 posts views Thread by Sean Berry | last post: by
5 posts views Thread by none | last post: by
2 posts views Thread by python programming newb | last post: by
2 posts views Thread by J | last post: by
3 posts views Thread by DaveJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.