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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:45:16+00:00 2026-06-13T10:45:16+00:00

I need to go through $_POST , but I don’t know which indexes are

  • 0

I need to go through $_POST, but I don’t know which indexes are used (i want to be able to update multiple users values(inputs have user ID as name). When I go through $_POST with foreach I’m getting the values, but I don’t know how to get user_id(index)

if(isset($_POST['credit_update'])){
foreach($_POST as $current){
}
}

i need to get index of $current

  • 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-06-13T10:45:17+00:00Added an answer on June 13, 2026 at 10:45 am

    You can read all about foreach in the manual. Here is the specific syntax you are looking for:

    foreach($_POST as $key => $current){
        //Do something
    }
    

    If you just want to update the array you can also get the element by reference in this way:

    foreach($_POST as &$current){
        //If you update $current inside the loop
        //the element will be updated in the array
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know how to solve this issue, I've trying reading many post but
I've looked through all the stuff to remove characters from strings but I don't
I need parse through a file and do some processing into it. The file
I have a huge ammount of photos that need sorting through. I need to
I need to parse through a string and add single quotes around each Guid
I need to loop through a List of Dictionaries List<Dictionary<string,string>> to populate a DataTable.
I need to iterate through all byte values (-128 to 127 inclusive). I could
I need to iterate through nested entities in a Twig template. Entity A ->
I need to parse through a CMS generated HTML page and add list item
I need to loop through a set of 2-dimensional array of hidden input fields

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.