If you want to remove the first items in the array for the key name Provinces and the numerical keys do not have to be preserved, you could also use array_splice:

$arr = [
    "Country" => "Canada",
    "Provinces" => [
        "Quebec",
        "Ontario",
        "British Columbia"
    ]
];
array_splice($arr["Provinces"], 0, 1);

Php demo

Or using unset to keep the numerical keys:

unset($arr['Provinces'][0]);
Answer from The fourth bird on Stack Overflow
๐ŸŒ
PHP
php.net โ€บ manual โ€บ en โ€บ function.array-shift.php
PHP: array_shift - Manual
<?php function array_last_entry($arr){ if(!is_array($arr)) return; if(empty($arr)) return; return end($arr); } function array_first_entry($arr){ if(!is_array($arr)) return; if(empty($arr)) return; reset($arr); return current($arr); } $arr = array( '5' => 'five', '3' => 'three', '8' => 'eight',); echo 'last entry: '.array_last_entry($arr).'<br>'; echo 'first entry: '.array_first_entry($arr).'<br>'; echo 'alternative output:<br>'; echo 'last entry: '.$arr[count($arr)-1]; echo '<br>first entry: '.$arr[0]; ?> The output will look like: last entry: eight first entry: five alternative output: last entry: first entry: As you can see, if you have to handle arrays with non-continuous indexes, these functions may be very helpful. ... no, it demonstrates quite well that it removes the first element in the original array, updating the keys, and that it also returns the original first element.
๐ŸŒ
W3Schools
w3schools.com โ€บ php โ€บ func_array_shift.asp
PHP array_shift() Function
<?php $a=array("a"=>"red","b"=>"green","c"=>"blue"); echo array_shift($a); print_r ($a); ?> Try it Yourself ยป ยท The array_shift() function removes the first element from an array, and returns the value of the removed element.
๐ŸŒ
Tutorial Republic
tutorialrepublic.com โ€บ faq โ€บ how-to-remove-the-first-element-from-an-array-in-php.php
How to Remove the First Element from an Array in PHP
You can use the PHP array_shift() function to remove the first element or value from an array. The array_shift() function also returns the removed value of array.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ php โ€บ remove-first-element-from-an-array-in-php
Remove First Element from an Array in PHP - GeeksforGeeks
July 23, 2025 - The array_slice() function is used to extract a portion of an array. By specifying a start index of 1, you can extract all elements except the first one. Example: This example shows the implementation of the above-explained approach.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ php โ€บ how-to-remove-first-element-from-an-array-in-php
How to Remove First Element from an Array in PHP? - GeeksforGeeks
July 23, 2025 - The array_shift() function removes the first element from an array and returns it. This function modifies the original array. ... <?php $arr = array(10, 20, 30, 40, 50, 60); $removedElement = array_shift($arr); echo "Removed element: " . ...
๐ŸŒ
Javatpoint
javatpoint.com โ€บ how-to-remove-first-element-from-an-array-in-php
How to remove first element from an array in PHP? - javatpoint
We are excited to announce that we are moving from JavaTpoint.com to TpointTech.com on 10th Feb 2025. Stay tuned for an enhanced experience with the same great content and even more features. Thank you for your continued support ยท To remove the first element or value from an array, array_shift() ...
๐ŸŒ
ItSolutionstuff
itsolutionstuff.com โ€บ post โ€บ how-to-remove-first-element-from-array-in-phpexample.html
How to Remove First Element from Array in PHP? - ItSolutionstuff.com
May 14, 2024 - This article goes in detailed on how to remove first element from array in php. you can understand a concept of remove first item from array in php. letโ€™s discuss about php remove first element from array. We will use php remove first item from array.
Find elsewhere
๐ŸŒ
Techfry
techfry.com โ€บ home โ€บ php tutorial โ€บ how to remove first element of array in php - array_shift() function
How To Remove First Element of Array in PHP - array_shift() Function - Tech Fry
June 24, 2023 - You can use the array_shift() function to remove the first element or value from an array. The array_shift() function returns the removed first value of array. If the array is empty (or the variable is not an array), the returned value is NULL.
๐ŸŒ
Sentry
sentry.io โ€บ sentry answers โ€บ php โ€บ deleting elements from an array in php
Deleting elements from an array in PHP | Sentry
If you want to delete an element from an array but you only know its value, you can use array_search() to find the key of the element, and then use unset() to remove the key-value pair.
๐ŸŒ
W3Schools
w3schools.com โ€บ php โ€บ php_arrays_remove.asp
PHP Remove Array Items
The array_shift() function removes the first item of an array. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com ยท If you want to report an error, or if you want ...
๐ŸŒ
TecAdmin
tecadmin.net โ€บ removing-first-element-from-array-in-php
Removing the First Element from an Array in PHP โ€“ TecAdmin
April 26, 2025 - The `array_shift()` function in PHP removes the first element or value from an array and returns that value.