$languages = array( 'French', 'German', 'Russian', 'Chinese');
printf("Original array:\n%s
\n", var_export($languages, TRUE));
$num = 2;
$removed1 = array_remove($languages, 0, $num);
$removed2 = array_remove($languages, count($languages) - $num, $num);
printf("Removed (start): %s
Removed (end): %s
Remaining: %s
\n", var_export($removed1, TRUE), var_export($removed2, TRUE), var_export($languages, TRUE));
?>