function array_remove(&$array, $offset, $length=1)
{
return array_splice($array, $offset, $length);
}
$languages = array( 'French', 'German', 'Russian', 'Chinese',
'Hindi', 'Quechua', 'Spanish', 'Hausa');
printf("Original array:
%s
\n", var_export($languages, TRUE));
$removed = array_remove($languages, 2);
printf("Removed: %s
Remaining:
%s
\n",
var_export($removed, TRUE), var_export($languages, TRUE));
$removed = array_remove($languages, 0, 3);
printf("Removed: %s
Remaining:
%s
\n",
var_export($removed, TRUE), var_export($languages, TRUE));
?>