Some one can tell me ?

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!

Moderator: General Moderators

Post Reply
myharshdesigner
Forum Commoner
Posts: 43
Joined: Sat Apr 21, 2007 8:23 pm

Some one can tell me ?

Post by myharshdesigner »

What we call this in PHP

Code: Select all

-->

Code: Select all

DOMNodelist->item()
where should we use this And When We use this ?
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

It's just an object delimiter. If have a class User you create a new object by calling:

$user = new User();

The $user object, an instance of User, needs a syntax to refer to all the properties and methods it contains. That operator is ->. So to perhaps set a User name, one could:

$user->setName('Me!');

This tells we're calling the setName() method of the $user object. The main exception is if a method or property is static, i.e. you don't need to create an object to use it. So one could create a global User name (assuming a static method exists!) using the different :: syntax.

User::setName('Me!');

The manual explains all this in more detail on the Object Oriented introduction for PHP5.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

We should turn one of these '->' posts into a sticky.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

superdezign wrote:We should turn one of these '->' posts into a sticky.
Few search, fewer still would know what to search for as "->" isn't possible to search for. And myharshdesigner, I need to remind you of another rule.... I grow tired of reminding you of these rules.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
myharshdesigner
Forum Commoner
Posts: 43
Joined: Sat Apr 21, 2007 8:23 pm

Post by myharshdesigner »

my dear friend i know the rule now always search in the form 1st the i post.
but for that

Code: Select all

->
sign i dont know how to search so i just post my query sir.
And if you provide me some result then i will so thanks full to you sir.

Thnaks
feyd wrote:
superdezign wrote:We should turn one of these '->' posts into a sticky.
Few search, fewer still would know what to search for as "->" isn't possible to search for. And myharshdesigner, I need to remind you of another rule.... I grow tired of reminding you of these rules.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
myharshdesigner
Forum Commoner
Posts: 43
Joined: Sat Apr 21, 2007 8:23 pm

Post by myharshdesigner »

Maugrim_The_Reaper wrote:It's just an object delimiter. If have a class User you create a new object by calling:

$user = new User();

The $user object, an instance of User, needs a syntax to refer to all the properties and methods it contains. That operator is ->. So to perhaps set a User name, one could:

$user->setName('Me!');

This tells we're calling the setName() method of the $user object. The main exception is if a method or property is static, i.e. you don't need to create an object to use it. So one could create a global User name (assuming a static method exists!) using the different :: syntax.

User::setName('Me!');

The manual explains all this in more detail on the Object Oriented introduction for PHP5.
THANKS
Post Reply