I have an associative like array["name"]="hello";
I am trying to get two random values from the array, the key name and the value, but 
using the codes below from the PHP manual i am getting the inex key value rather than 
the name.

$rand_keys = array_rand ($input, 2);
print $input[$rand_keys[0]]."\n";
print $input[$rand_keys[1]]."\n";

so instead of getting two random values like key=name & value="hello" i am getting 
key=0 and value=hello.

How do i get the name of the key not the index number?

Thanks in advance

-awlad

Reply via email to