It is an in-built function in PHP that is used to show element values of a given array in a new array. PHP array_values function creates a new array in which it stores only values of elements from a given array and by default gives the numerical keys to every single value.
<?php $arr=array("Name"=>"warner","Age"=>"24","Country"=>"USA"); echo "<pre>"; print_r(array_values($arr)); echo "</pre>"; ?>
 => Ali
 => 20
 => Pakistan
Now you can see a new array has been created and only values are showing in it.
In this tutorial, we learned about the array_values function, see the definition, and then discuss a example. You can also learn