<?php $array = [1,11,10,101,3];sort($array);print_r(array_slice($array, 0, 3));
Standard input is empty
Array ( [0] => 1 [1] => 3 [2] => 10 )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!