why we use array_values() function in php ?
The array_values() function use for returns an array which have all the values of an array.
you can see below example:
<?php
//firstly create a array of a city detail
$Citydetail=array("cityname"=>"Adoor","Zipcode"=>"221221","Countryname"=>"India");
// here $Citydetail is a variable that containing all the values of an array.
//print citydetail value
print_r(array_values($Citydetail));
//here use array_value function for return the array
?>
//output will come
Array (
[0] => Adoor
[1] => 221221
[2] => India
)
0 Comment(s)