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" <bl************@gmail.comwrote in message
news:bf**********************************@j20g2000 hsi.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!