Php array values
From w3cyberlearnings
Contents |
PHP function array_values
This function returns all the array values from a given array.
Syntax array_values
- array: array input
array_values(array);
Example 1: Get all the scores
<?php $score = array( 'Taylor' => 32, 'Lucas' => 12, 'Makayla' => 42, 'Jennifer' => 12, 'Lucas Team' => 313 ); $array_val = array_values($score); print_r($array_val); ?>
Output
Array ( [0] => 32 [1] => 12 [2] => 42 [3] => 12 [4] => 313 )
Related Links
- array_change_key_case
- array_chunk
- array_combine
- array_count_values
- array_diff_assoc
- array_diff_key
- array_diff_uassoc
- array_diff_ukey
- array_diff
- array_fill_keys
- array_fill
- array_filter
- array_flip
- array_intersect_assoc
- array_intersect_key
- array_intersect_uassoc
- array_intersect_ukey
- array_intersect
- array_key_ exists
- array_keys