Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- PHP Array in a function


ericlewis107 - 11:25 am on Dec 7, 2012 (gmt 0)


array_values($arr) function accepts a PHP array and returns a new array containing only its values (not its keys). Its counterpart is the array_keys() function. Use this function to retrieve all the values from an associative array.

Code:
$data = array("hero" => "Holmes", "villain" => "Moriarty");
print_r(array_values($data));
?>

Output:
Array
(
[0] => Holmes
[1] => Moriarty
)


Thread source:: http://www.webmasterworld.com/php/4521054.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com