Q: PHP display some items from an array I have a big array which i need to display the latest 10 items in it only.
what is the best php code to do that?
thanks

A: Use array_slice
$printing = array_slice($array, -10);

print_r($printing); //or however you want to print it.


A: foreach( array_slice( $array, -10 ) as $k => $v ) {
    echo $v;
}

