How to extract the keys and values of an array without index

$keys = array_keys($array);
$values = array_values($array);

Note however that array(0=>'item') and array('item') are exactly identical as far as PHP is concerned. There is no such thing as a php array item without an index. If you do not supply an index PHP will silently add a numeric index.


$array1 = array_keys($array);
$array2 = array_values($array);

well, you can read here.

In computer science, an array data structure or simply an array is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula.