Sorry, the array i use is a "multi-dimensional" array of the form
$array = array(
'string1' => array('a' => '', 'b' => , 'c' => ''),
'string2' => array('a' => '', 'b' => , 'c' => ''),
'string3' => array('a' => '', 'b' => , 'c' => ''),
);
array_search() does not work for multidimensional arrays (i tried for this)
So i preferred using foreach and incrementation
my solved code is
function find_array_index($to_find_Key = '', $in_Array = ''){
$index = 0;
foreach ($in_Array as $key => $value) {
if($key == $to_find_Key){
return $index;
}
$index++;
}
}
using find_array_index('string2', $array); gave me the result 1
Anyway thanks all for your support !