PHP array_values function

array_values

(PHP 4, PHP 5)

array_values -- Return all the values of an arrayDescriptionarray array_values ( array input )

array_values() returns all the values from the
input array and indexes numerically the
array.

Example 1. array_values() example

$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));

The above example will output:


Array
(
[0] => XL
[1] => gold
)

See also array_keys().

  • Digg
  • TwitThis
  • del.icio.us
  • Netvouz
  • description
  • Reddit
  • Furl
  • NewsVine
  • Simpy
  • Slashdot
  • Spurl
  • StumbleUpon
  • YahooMyWeb
  • TailRank
  • Technorati
  • Facebook
  • Google
  • LinkedIn
  • Live
  • MySpace
  • Ping.fm
  • Yahoo! Buzz
  • E-mail this story to a friend!



Home | PHP Functions | PHP array_values function