If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
array_shift() function , Array में से first element remove करता है। और removed element को ही return करता है।
array_shift( array $array );
array $array | required : $array Array variable है , जिसमे से value remove करनी है।
Return Value : removed element को ही return करता है।
अगर pass किया गया Array empty है तो , null return होगा।
File : php_array_shift.php
<?php
$stack = array("orange", "banana", "apple", "raspberry");
echo "Removed element : ". array_shift($stack);
echo "<br>";
print_r($stack);
?>
Removed element : orange Array ( [0] => banana [1] => apple [2] => raspberry )
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook