我試圖從的foreach刪除一些陣列 例如,對於「結果」數組一些數組:你如何刪除的foreach
$result= array (
"1" => array(
"nickname" => "Jow",
"Age"=> "19"
),
"2" => array(
"nickname" => "Rayan",
"Age"=> "25"
),
"3" => array(
"nickname" => "Jinx",
"Age"=> "21"
),
);
我想暱稱刪除陣列1 mycode的:
foreach ($result as $client => $value){
if ($value["nickname"] == "Jow"){
unset($result[$client]);
}
echo $value["nickname"].'<p>';
}
最後我要像RAYAN和金克斯
退房'array_filter' – Ghost
@RodrigoDuterte Oi!你在這裏。選舉近了。變化真的到來了嗎? – rhavendc
你想要什麼? – suibber