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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:05:36+00:00 2026-05-25T11:05:36+00:00

Thank you for looking at and taking time to answer my question! I would

  • 0

Thank you for looking at and taking time to answer my question!

I would like to use a multi-dimensional array in a form on my site and then access it using the keys; Like so.

<form method="post" action="somescript.php">
    <input type="text" name="name[1][title]">
    <input type="text" name="name[1][descritpion]">
</form>

I would then like to access both the index, since that is the ID, and the value of the given _post’ed element. Something like

$keys = array_keys($_POST['name']);
 foreach($keys as $id)
 {
      echo "title: " . $_POST['name']['title'][$id];
      echo "description: " . $_POST['name']['description'][$id];
      echo "id: " . $id;
 }

Now, the above looks nice and it prints out the correct $id but thats about it. I assume I am putting the “title” or “description” array calls in the wrong place but cannot figure it out. Could someone kindly point me in the right direction?

  • 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-25T11:05:37+00:00Added an answer on May 25, 2026 at 11:05 am

    In your PHP, you are looking for $_POST['name']['title'][$id], but in your HTML you have name[1][title].

    These are not the same array. You either need to change the HTML to name[title][1], or the PHP to $_POST['name'][$id]['title'].

    It doesn’t matter which you use, just be consistent, though I suggest using name[title][1] as that may be easier to work with.

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

Sidebar

Related Questions

Thanks for taking the time to read my question. I am looking for advice
Thanks for looking at this question. I wanted to know how can I use
Bounty clarification I know it's a subjective question. The ideal answer I'm looking is
Hi there and thank you for taking the time to look into this. I'm
and thank you for taking the time to read my post. I am currently
Hi there and thanks for taking the time for this question. I'm using a
Here's what I would like to do: I'm taking pictures with a webcam at
thank you for looking i got this example from my book but i cant
Thank you for the answers. :) I'm mainly looking to host my website with
Thanks for looking. All sincerely helpful answers are voted up. I use a password

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.