print key of first element of array_search() in php
I have following code
public static $_myarray = array('This is S' => 'S', 'This is RC' => 'RC', 'This is RF' => 'RF', 'This is C' => 'C'); $check_var = 'S';
i am trying to get this
echo $key_of_array = array_search($check_var,$_myarray); // output should be 'This is S'
it is returning blank value instead of "This is S"
I tried with following as well.
-> type casting of $check_var
but no luck. can anyone please help me to sort out this ?
Note : it works well for other values .. issue is only with first element of array .. and i am checking this on Linux