[Solved] How to convert an associative array into a simple array in php? [closed]


For which purpose do you need the array?

If you want to use JSON data, just try to call json_encode on the array:

$array = array('NBA', 'MGNREGS');
var_dump($array);
print json_encode($array);

Output:

array(2) { 
  [0]=> string(3) "NBA"
  [1]=> string(7) "MGNREGS"
}

["NBA","MGNREGS"]

4

solved How to convert an associative array into a simple array in php? [closed]