array_shift
array_shift — Shift an element off the beginning of array.Description
array_shift( array &$array ): mixedarray_shift() shifts the first value of the array off and returns it, shortening the array by one element and moving everything down. All numerical array keys will be modified to start counting from zero while literal keys won't be affected.
Note: This function will reset() the array pointer of the input array after use.
Parameters
array
The input array.
Return Values
Returns the shifted value, or null if array is empty or is not an array.More information about array_shift on official PHP documentation site
array_shift - Popular snippets
- PHP 5 / MySQL 5.7 array_shift sort preg_match
last run:
2022-03-31 06:16:50
6
- PHP 7 / MySQL 5.7 array_shift sort preg_match
last run:
2022-03-31 04:57:01
4
- PHP 8.0 / MySQL 5.7 preg_match_all reset array_reduce trim array_shift
last run:
2021-11-26 13:24:37
4
- PHP 8.0 / MySQL 5.7 array_map explode array_shift implode array_keys array_combine array_values var_export
last run:
2022-04-21 09:41:50
3
- PHP 5 / MySQL 5.7 array_shift sort preg_match
last run:
2022-03-31 09:07:05
2
- PHP 8.0 / MySQL 5.7 array_shift sort preg_match
last run:
2022-03-31 04:57:03
2
- PHP 5 / MySQL 5.7 array_shift preg_match
last run:
2022-03-31 04:27:17
2
- PHP 5 / MySQL 5.7 array_shift
last run:
2022-03-31 04:25:36
2
- PHP 5 / MySQL 5.7 array_shift print_r
last run:
2022-01-20 12:43:10
2
- PHP 5 / MySQL 5.7 array_shift print_r
last run:
2022-01-20 12:42:13
2
array_shift - New snippets
-
PHP 8.0 / MySQL 5.7 array_map explode array_shift implode array_keys var_export array_combine array_values
added at:
2022-04-20 22:01:14
1
-
PHP 8.0 / MySQL 5.7 array_map explode array_shift implode array_keys array_combine array_values var_export
added at:
2022-04-20 22:01:00
3
-
PHP 8.0 / MySQL 5.7 array_map explode array_shift implode array_keys var_export array_combine array_values
added at:
2022-04-20 22:00:18
1
-
PHP 8.0 / MySQL 5.7 array_map implode array_shift explode array_keys var_export array_combine array_values
added at:
2022-04-20 21:59:54
1
-
PHP 8.0 / MySQL 5.7 array_map implode array_shift explode array_keys var_export array_combine array_values
added at:
2022-04-20 21:59:47
1
-
PHP 5 / MySQL 5.7 array_shift sort preg_match
added at:
2022-03-31 06:16:41
2
-
PHP 5 / MySQL 5.7 array_shift sort preg_match
added at:
2022-03-31 06:16:31
1
-
PHP 5 / MySQL 5.7 array_shift sort preg_match
added at:
2022-03-31 06:15:47
1
-
PHP 7 / MySQL 5.7 array_shift sort preg_match
added at:
2022-03-31 04:50:13
4
-
PHP 5 / MySQL 5.7 array_shift sort preg_match
added at:
2022-03-31 04:49:51
1