Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
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.
is it just by mistake or it has special effect ?
Thank u very much
- New php-forum User
- Posts: 7
- Joined: Sun Sep 29, 2002 9:36 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: No registered users and 2 guests