Voting

: max(six, zero)?
(Example: nine)

The Note You're Voting On

Anonymous
18 years ago
array_diff provides a handy way of deleting array elements by their value, without having to unset it by key, through a lengthy foreach loop and then having to rekey the array.

<?php

//pass value you wish to delete and the array to delete from
function array_delete( $value, $array)
{
$array = array_diff( $array, array($value) );
return
$array;
}
?>

<< Back to user notes page

To Top