분류 php

첫 번째 요소를 제외한 배열의 모든 요소를 ​​반환

컨텐츠 정보

  • 조회 640 (작성일 )

본문

<?php
function tail($items)
{
    return count($items) > 1 ? array_slice($items, 1) : $items;
}
tail([1, 2, 3]); // [2, 3]
php