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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:59:30+00:00 2026-05-27T17:59:30+00:00

I have into $_POST array all the data i need. If I print_r the

  • 0

I have into $_POST array all the data i need.

If I print_r the array, I see something like this:

Array (
  [0_45_115] => 01
  [0_46_115] => 01
  [0_47_115] => 01
  [0_48_115] => 01
  [0_49_115] => 01
  [0_50_115] => 01
  [0_51_115] => 01
  [0_52_115] => 01
  [0_53_115] => 01
  [0_54_115] => 01
  [0_55_115] => 01
  [0_56_115] => 01
  [0_57_115] => 01
  [0_58_115] => 01
  [0_59_115] => 01
  [0_60_115] => 01
  [0_61_115] => 01
  [0_62_115] => 01
  [0_63_115] => 01
  [0_64_115] => 01
  [0_65_115] => 01
  [0_66_115] => 01
  [0_67_115] => 01
)

The index i post from the form (the name attr) doesn’t have underscores. For example:

<input type="text" name="0 45 115" value="" />

Let’s forget this.

0_45_115 which the index is will provide me all the neccessery data I want to update or insert a new row into my database. The value will saw me the information I want.

The problem is that I don’t know how to manage the array. Maybe I must use foreach method, and the I will use split function to split the index of each row. Then I will do all the other stuff for insertion/update my database.

I ask how can I use foreach to take the info (index-data) from $_POST array.

  • 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-27T17:59:31+00:00Added an answer on May 27, 2026 at 5:59 pm

    The spaces are converted to underscores per PHP specifications. See this page for more details. Specifically, search for this string in the page: Dots and spaces in variable names are converted to underscores.

    I think the right approach would be

    foreach($_POST as $key => $value)
    {
        $parts = explode('_', $key);    //split your $key
        //then deal with corresponding $value
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have stumbled into several methods of looping in JavaScript, what I like the
I have run into this problem before but never quite solved it. I have
Here's the thing, I don't have access to code that inserts data into a
I have a php page where users may enter data into fields inside a
This may not be possible, but I'd like to ask anyway and see if
I need to serialize all inputs from a form into a JSON string. With
I am attempting to export mysql data into excel. I have tried the phpexcel
Lets assume that I cant successfully access $_POST array but I do have the
All the data is being passed as I have sufficiently tested over and over
I currently have a webpage where an iframe contains data that is stored into

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.