Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Differences in code

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Differences in code

Postby eddy05 » Thu Mar 13, 2003 7:38 pm

What are the differences between:

Object("Something");
Object["Something");
Object->Something;
Object=>Something;

I've seen these in php.net but not fully sure what is it.
User avatar
eddy05
New php-forum User
New php-forum User
 
Posts: 10
Joined: Tue Mar 04, 2003 6:46 pm
Location: Singapore

Postby Xerpher » Thu Mar 13, 2003 8:00 pm

Object("Something");

This will call a function called Object and will put the variable "Something" in it.


$Object["Something"];

This will get the contents of the array Object from its child "Something".


$Object->Something;

This will call the class $Object and will get the contents of the variable $Something in it.


Object => Something;

Syntax for defining array child Object to equal Something.
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby eddy05 » Thu Mar 13, 2003 11:32 pm

THANKS! It was very useful. Got it into my head :)
User avatar
eddy05
New php-forum User
New php-forum User
 
Posts: 10
Joined: Tue Mar 04, 2003 6:46 pm
Location: Singapore

Postby Xerpher » Fri Mar 14, 2003 12:21 pm

No problem, I'm glad to help :)
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.