Posted by Kimmo Laine on 11/28/48 11:53
"monomaniac21" <mcyi2mr3@googlemail.com> wrote in message
news:1153393402.467503.199960@i42g2000cwa.googlegroups.com...
> What i cant see is how the function finds out the name given to each
> row of the array?
>
> Can anyone explain this to me?
It's using a feature of php called variable variable.
let's say you have a couple of variables:
$name = "fred flintstone";
$pointer = "name";
You can point to variable $name with the $pointer using the variable
variable syntax: $$pointer is evaluated as $"name", and since $pointer
contains the string "name".
echo $$pointer; // This will print "fred flintstone"
The very same mechanisms is used in the example function.
--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|