How to use array values in PHP
In this article, I will explain how the array_values() function can be used in PHP.
array_values() function in PHP
-
The array_values() function is used to returns an array containing all the values from an array.
-
The array_values() function returned array will have numeric keys, starting at 0 and increase by 1.
Syntax
Parameter
Example
The following example show to how the array_values() function can be used in PHP.
<html>
<body>
<h3 style="color: darkorchid;">array_values() function example in PHP</h3>
<?php
$a=array("a"=>"Student","b"=>"Engg.","c"=>"Worker");
print_r(array_values($a));
?>
</body>
</html>
|
Output
You may also want to read these related articles here
Ask Your Question
Got a programming related question? You may want to post your question here