How to php convert associative array to indexed array in PHP

get index  of array in php
<?php
$arr
=array('index1' =>'value1' "index2" =>'value2' "index3"=>'value3'); 


$ar=array_values($arr); // convert to indexing  array 


$key=array_keys($arr); // get index name 


for($i=0$icount($ar) ; $i++){
echo 
$key[$i]."=".$ar[$i]."<br> ";
}
 
?>

output

index1=value1
index2=value2
index3=value3

Comments

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

List of Post Category Wise in wordpress