我正面临着这个问题,我似乎无法想出办法。我有这样的数组,
$array = [(
"name" => "marks", "score" => 24),
("name" => "arsh", "score"=>54),
("name" => "jack" , "score" =>32),
("name" => "welch" , "score" =>34),
("name" => "sid" , "score" =>32)];
如何选择前n个数组,比如说我需要前2个数组。因此,如何从这些数据中得到这样的输出,
$array = [(
"name" => "marks", "score" => 24),
("name" => "arsh", "score"=>54)]
由于