Answers for "php get all elements of array except last"

PHP
1

php get all elements of array except last

$array = array( 1,2, 3 );
$sliced = array_slice($array, 0, -1); // array ( 1,2 )
Posted by: Guest on July-02-2021

Code answers related to "php get all elements of array except last"

Browse Popular Code Answers by Language