How to get numeric index of associative array in php?

The array_keys() function is an inbuilt function in PHP which is used to return either all the keys of an array or the subset of the keys.

1. Code:


// Program to print index of an associative array
// Declare an associative array
$assoc_array=array("Soltuts"=>10, "for"=>15, "sol"=>20); 
// Print index with corresponding key
// using array_keys() function

2. Example:


Array("Soltuts"=>10, "for"=>15, "sol"=>20); 


Array ( [0] => Soltuts [1] => for [2] => sol )