php is having a function to extract slice of an array.
Find below the syntax of this function array_slice().
$outputarray=array_slice($inputarray,$offset,$length);
Here, the length argument is optional.
If you want to remove first two items from an array, you can use as below,
$arrNames=array_slice($arrNames,2);
We can specify negative number also as the offset. In this case, it will be taken from end of the array.
More Articles...
Shop at Rajamanickam.com | Birthday Gift Idea? | Hire me for $6 per Hour
Get 3 useful ebooks for Rs 99 in India and $5.99 globally
Get a 75% commission | ChatGPT and and Google Gemini for Beginners (Use Discount code QPT)
Search This Blog
Art of Talking to AI | Tech eBook | Dream Big | Listen to Dream Big
Today's Deals | Timesheet | Products | 3 ebooks for $5.99 / Rs 99 | Earn 50% commission
About | Privacy | Follow | TOS | WhatsApp | Contact
I may earn a commission from Amazon affiliate links
Today's Deals | Timesheet | Products | 3 ebooks for $5.99 / Rs 99 | Earn 50% commission
About | Privacy | Follow | TOS | WhatsApp | Contact
I may earn a commission from Amazon affiliate links
No comments:
Post a Comment