What is wrong here!!! PLEASE code wil not even run!!
There is nothing wrong in the code block. But that have a blank output.
Because
$ty = in_array($fe, $ar, true); return false. So that the 'else' block is working and there is no echo or any statement to output in the browser.
You can use this:
$ar = array("1" , "2" , "3");
$fe = '5';
$ty = in_array($fe, $ar, true);
if ($ty)
{
$gh = array_search($fe, $ar);
echo "$gh";
}
else
{
$gh ='0';
echo $gh;
}
You will find the output is 0.