Re: note 9326 added to array_values
| From: | J. M. Castagnetto | Date: | Sat, 28 Oct 2000 00:01:24 +0000 |
| Subject: | Re: note 9326 added to array_values | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7114@lists.php.net to get a copy of this message | ||
You are wrong, the following code works:
<?php
$a = array("one"=>"uno", "two"=>"dos",
"three"=>"tres");
print_r(array_keys($a));
print_r(array_values($a));
?>
Ouputs:
Array
(
[0] => one
[1] => two
[2] => three
)
Array
(
[0] => uno
[1] => dos
[2] => tres
)
BTW, for support use the resources at
www.php.net/support.php
--- perly_white@yahoo.com wrote:
> Actually, I'm finding that the given example is,
> sadly, correct. array_values() isn't apparently
> meant for use in associative arrays.
>
> In other words, the term "values" in the function
> name isn't meant to term it as the opposite of
> array_keys().
>
> Somebody please tell me that I'm wrong!
>
> http://www.php.net/manual/function.array-values.php
>
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-notes-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-notes-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf! It's FREE.
http://im.yahoo.com/