|
Posted by Peter Pei on 09/29/46 12:01
How amazing this is. His code worked with 5.2.5 for sure. Obviously none of
the previous repliers cared to test his code, and went ahead with stupid
answers any way.
His code works 100% as long as he calls it the right way, for example
printArrayStr("age"). Obviously he will get notice if he calls
printArrayStr(age).
make sure your answers is relevant, otherwise you are playing pure stupid.
=============================================
"Giovanni" <blastingproton@gmail.com> wrote in message
news:bfe96afe-98dc-4850-98a8-890b0de68daf@j20g2000hsi.googlegroups.com...
> Hi! I've an array of string like this:
>
> $arraystring["name"]="John";
> $arraystring["age"]="50";
> $arraystring["work"]="teacher";
>
> $arraystring is global variable.
>
> I'm trying to code a function that get a string as parameter and print
> the relative arraystring's value.
>
> function printArrayStr($key)
> {
> global $arraystring;
> echo $arraystring["$key"];
> }
>
> What do I wrong?! :(
>
> tnx, people!
Navigation:
[Reply to this message]
|