Jump to: navigation, search

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


Navigation
Web
SQL
MISC
References