我有這樣的陣列:刪除數組值文本
$array = array(
[0] => "obm=SOME_TEXT",
[1] => "sbm=SOME_TEXT",
[2] => "obm=SOME_TEXT"
);
如何刪除含有值obm
或sbm
(總是在陣列中的柱的頂部)陣列的元件(一個或多個)和更新索引?
實施例1:
print_r(arrRemove("smb", $array));
輸出:
$array = array(
[0] => "obm=SOME_TEXT",
[1] => "obm=SOME_TEXT"
);
實施例2:
print_r(arrRemove("omb", $array));
輸出:
$array = array(
[0] => "sbm=SOME_TEXT"
);
我不知道我該怎麼做... – Xriuk