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

  • SEARCH
  • Home
  • 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 6893377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:39:03+00:00 2026-05-27T06:39:03+00:00

I have an array (produced by uploading multiple files) that returns this: Array (

  • 0

I have an array (produced by uploading multiple files) that returns this:

Array
(
[name] => Array
    (
        [0] => lightshow.png
        [1] => mia.guyana.jpg
        [2] => skanking.jpg
    )

[type] => Array
    (
        [0] => image/png
        [1] => image/jpeg
        [2] => image/jpeg
    )

[tmp_name] => Array
    (
        [0] => /Applications/MAMP/tmp/php/phph7f4nD
        [1] => /Applications/MAMP/tmp/php/phppS2YDH
        [2] => /Applications/MAMP/tmp/php/phptebtKr
    )

[error] => Array
    (
        [0] => 0
        [1] => 0
        [2] => 0
    )

[size] => Array
    (
        [0] => 160325
        [1] => 153524
        [2] => 29054
    )

)  

I need to pull each key value pair into a seperate array within a foreach loop for processing that would return something like this:

Array
(
[name] => lightshow.png
[type] => image/png
[tmp_name] => /Applications/MAMP/tmp/php/phph7f4nD
[error] => 0
[size] => 160325
)

Any ideas?

  • 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-27T06:39:04+00:00Added an answer on May 27, 2026 at 6:39 am

    Thanks guys, I eventually answered my own question after testing out jsaloen & Sean’s answers which were both close, but not quite what I wanted. My solution may probably be kind of ham-handed, but it works!

        if (isset($_FILES['files'])) {
    
            $userfiles = $_FILES['files'];
    
            $limit = count($userfiles['name']);
    
            $i = 0;
    
            while ($i < $limit) {           
    
                    $userfile = array(
                    'name' => $userfiles['name'][$i],
                    'type' => $userfiles['type'][$i],
                    'tmp_name' => $userfiles['tmp_name'][$i],
                    'error' => $userfiles['error'][$i],
                    'size' => $userfiles['size'][$i]
                );
    
                $i++;
    
                echo "<pre>";
                print_r($userfile);
                echo "</pre>";
    
            }
    
        }
    

    I haven’t tried out deceze’s answer yet, I don’t quite understand it yet! It utilizes stuff that I haven’t learned yet!

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

Sidebar

Related Questions

I have array like this: $path = array ( [0] => site\projects\terrace_and_balcony\mexico.jpg [1] =>
I have a project that needs to produced an array list of hexadecimal colour
I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>
I have an array of numbers that potentially have up to 8 decimal places
I have an array structure that have to be converted to MXML. I know
I have an array produced by numpy which looks as follows: [ 54.51399994 -12.10200024
I have created a piece of code that checks files for a user-submitted string
I have byte array as input. I would like to convert that array to
Say I have an array of Strings declared like this: String[] strings = new
I have a multidimensional array in PHP produced by the great examples of icio

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.