i have an array like below:
$array=["satu"=>"mangga","dua"=>array("melon","apel")];
how can i get "dua" with $buah="melon"
I tried with this method, when $buah = "mangga" , the output is "satu" but when $buah = "melon" i got nothing, how can i get "dua" with $buah="melon". thank you
$array=["satu"=>"mangga","dua"=>array("melon","apel")];
$buah = "melon";
$a = array_search($buah,$array);
if(is_array($a)){
$x= array_search($buah,$a);
echo $x;
}else{
echo $a;
}