How to get the last n items in a PHP array as another array? May 25, 2023 by Tarik $n is equal to the number of items you want off the end. $arr = array_slice($old_arr, -$n);