Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 832913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:26:14+00:00 2026-05-15T04:26:14+00:00

I have an array like Array ( [0] => A [2] => B [4]

  • 0

I have an array like
Array

(
    [0] => A
    [2] => B
    [4] => C
    [6] => D
)

I want to remove the first element and then re-index array to get the output

(
    [0] => B
    [1] => C
    [2] => D
)

Which PHP function i need to use?


Update

Input array is

Array
(
    [0] => Array
        (
            [0] => Some Unwanted text
            [1] => You crazyy
        )

    [2] => Array
        (
            [0] => My belowed text
            [1] => You crazyy
        )

    [10] => Array
        (
            [0] => My loved quote
            [1] => You crazyy
        )

)

And the output should be like

Array
(
    [0] => Array
        (
            [0] => My belowed text
            [1] => You crazyy
        )

    [1] => Array
        (
            [0] => My loved quote
            [1] => You crazyy
        )

)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:26:15+00:00Added an answer on May 15, 2026 at 4:26 am

    With array_splice.

    http://www.php.net/manual/en/function.array-splice.php

    php > print_r($input);
    Array
    (
        [0] => A
        [2] => B
        [4] => C
        [6] => D
    )
    php > array_splice($input, 0, 1);
    php > print_r($input);
    Array
    (
        [0] => B
        [1] => C
        [2] => D
    )
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array that looks like $numbers = array('first', 'second', 'third'); I want
I have an array of array like below with all numeric values. I want
Suppose I have an array like this: $array = array(a,b,c,d,a,a); and I want to
I have a numpy array like this a = np.array(1) Now if I want
Think I have an integer array like this: a[0]=60; a[1]=321; a[2]=5; now I want
I have a NumPy array [1,2,3,4,5,6,7,8,9,10,11,12,13,14] and want to have an array structured like
I want to have a large 2 dimensional array such like int myArray[10000][2]; I
I have a variable like $path = dir1/dir2/dir1/dir4/; etc.. etc.. I want to remove
How do I remove index from http://localhost/dashboard/index/create I have my urlManager setup like this:
Possible Duplicate: Is there a PHP function to remove any/all key/value pairs that have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.