/ Published in: PHP

This PHP code snippet searches a value in an array. Depending on use, one or all matching values and their belonged keys are removed.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* EXAMPLE print_r(array_remove(array('d','a','d','u'),'d',true)); */ function array_remove($array,$value,$remove_all=false) { switch($remove_all): case false: break; case true: break; endswitch; return $array; }
Comments
