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 6922139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:22:04+00:00 2026-05-27T10:22:04+00:00

I have here what I would call a dirty array, this dirty array needs

  • 0

I have here what I would call a dirty array,
this dirty array needs to be filtered so it is a clean array e.g.

Below is the Array.

array
  0 => string '1' (length=1)
  1 => string 'FIRSTNAME A' (length=7)
  2 => string 'LASTNAME B' (length=10)
  3 => string '2011-12-08 16:15:37' (length=19)
  4 => string '2' (length=1)
  5 => string 'FIRSTNAME B' (length=7)
  6 => string 'LASTNAME B' (length=10)
  7 => string '2011-12-08 16:15:43' (length=19)
  8 => string '3' (length=1)
  9 => string 'FIRSTNAME C' (length=7)
  10 => string 'LASTNAME C' (length=10)
  11 => string '2011-12-08 16:15:48' (length=19)
  12 => string '4' (length=1)
  13 => string 'FIRSTNAME D' (length=7)
  14 => string 'LASTNAME D' (length=10)
  15 => string '2011-12-08 16:15:55' (length=19)
  16 => string '6' (length=1)
  17 => string 'FIRSTNAME E' (length=7)
  18 => string 'LASTNAME E' (length=10)
  19 => string '2011-12-08 16:16:08' (length=19)

I want the final output to look like

array[0]= 1, FIRSTNAME A, LASTNAME A, DATE

array[1]= 2, FIRSTNAME B, LASTNAME B, DATE

array[2]= 3, FIRSTNAME C, LASTNAME C, DATE

array[3]= 4, FIRSTNAME D, LASTNAME D, DATE

array[4]= 4, FIRSTNAME E, LASTNAME E, DATE
  • 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-27T10:22:04+00:00Added an answer on May 27, 2026 at 10:22 am

    This should work

    $clean = array_chunk($dirty, 4);
    

    more about array_chunk

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any help here would be greatly appreciated. I have this table hospital Nurse |
This discussion started over here but I thought it would be nice to have
I've hit a blank here and would appreciate a kick start. I have two
I have already posted something similar here but I would like to ask the
Have a look here: In the following code, what would be the type of
I suppose similar problem would have been discussed here, but I couldn't find it.
I have a folder path stored in the property nightly.basepath (here the value would
Here's the issue: I have 2 data contexts that I would like to do
I have a space in which I would like certain elements (represented here by
Here's my problem: I have do create a menu/list of actions (which would be

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.