I have an array and will use it in two ways, in one I will use all elements of this array, and in the other I will limit to, for example, 2 elements, eg
$array = ('nome'=>'Ribossomo', 'snome'=> 'Silva', 'idade'=> 500);
using all elements:
$user = $array;
Now, how can I get only the first 2 elements of this array? for example, the elements nome
and snome
$teste = ?