new to PHP

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

qadeerbk
New php-forum User
New php-forum User
Posts: 7
Joined: Sun Sep 29, 2002 9:36 am

new to PHP

Postby qadeerbk » Wed Oct 02, 2002 4:26 am

I am new to PHP, and I just want to ask that some time I see the PHP coding( the codes, available on net) in whoch the variable name contains 2 doller sign.
like

return $$x;

is it just by mistake or it has special effect ?

Thank u very much

Jay

Postby Jay » Wed Oct 02, 2002 8:38 am

It means a variable variable! Sounds complicated but it's quite simple!

Say you have two variables:
$apple = 5;
$orange = 10;

And the user selects a $fruit variable, so $fruit = "apple", then $$fruit = 5. This is because $fruit = "apple", and then you've got another $ sign, so it's $apple which we know to be 5!


Return to “PHP coding => General”

Who is online

Users browsing this forum: Strider64 and 3 guests