At 12:48 18.03.2003, Awlad Hussain said:
[snip]
>Thanks for your reply, I now have only the keys but I need both keys and the
>value.
[snip]
But you can get the value if you have the keys, no?
--
>O Ernest E
y, March 18, 2003 11:45 AM
Subject: Re: [PHP] Random array values from associative
> At 12:40 18.03.2003, Awlad Hussain said:
> [snip]
> >I have an associative like array["name"]="hello";
> >I am trying to get two rand
At 12:40 18.03.2003, Awlad Hussain said:
[snip]
>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 va
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]].
4 matches
Mail list logo