array_values in php

PHP also provides a (generally less useful) function to retrieve an array of just the values in an array, array_values():

$arrayOfValues = array_values(array);

$person = array(‘name’ => “Fred”, ‘age’ => 35, ‘wife’ => “Wilma”);

$values = array_values($person); // $values is array(“Fred”, 35, “Wilma”)

Leave a Comment