過濾函數function my_filter($arr){$filterDatum = 'what you set';foreach($arr as $k => &$item){if(is_array($item){my_filter($item);}else{ // item is an elementif"/> 過濾函數function my_filter($arr){$filterDatum = 'what you set';foreach($arr as $k => &$item){if(is_array($item){my_filter($item);}else{ // item is an elementif">
data-id="1190000005075514" data-license="nd">
過濾函數
<code>function my_filter($arr){ $filterDatum = 'what you set'; foreach($arr as $k => &$item){ if(is_array($item){ my_filter($item); }else{ // item is an element if($item == $filterDatum){ unset($arr[$k]); } } } return $arr; } </code>
過濾實作語句
<code>$arr = [ // who know what the array looks like. ]; $arr = array_filter($arr, 'my_filter'); </code>
BINGO
參考