remove all items of an array except the last 5 in php

Solutions on MaxInterview for remove all items of an array except the last 5 in php by the best coders in the world

showing results for - "remove all items of an array except the last 5 in php"
Christopher
24 Aug 2019
1$a5 = array_slice($arr, -5);
2