Blog Archives
PHP – Reset Array keys
To reset the array keys by taking array values only and stored it destination array.
The syntax is
$arr_destination = array_values($arr_source);
Suppose we take an example of array as
$arr_data = array(10,20,”three”=>30);
To reset the above array by
$arr_data1 = array_values($arr_data);
The output of the above example is,
$arr_data1 = array(10, 20, 30);