我有这个数组:
$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"
);