PHP: Remove the first and last item of the array

前端 未结 7 476
旧巷少年郎
旧巷少年郎 2021-01-31 07:47

Suppose I have this array:

 $array = array(\'10\', \'20\', \'30.30\', \'40\', \'50\');

Questions:

What is the fastest/

7条回答
  •  被撕碎了的回忆
    2021-01-31 08:23

    Check this code:

    $arry = array('10', '20', '30.30', '40', '50');
    $fruit = array_shift($arry);
    $fruit = array_pop($arry);
    print_r($arry);
    

提交回复
热议问题