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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:25:34+00:00 2026-05-21T20:25:34+00:00

A great feature of PHP is that it handles arrays in request variables, so

  • 0

A great feature of PHP is that it handles arrays in request variables, so if you post a string like ...&test[one]=two&test[three]=four then you can access test as an array by using $_REQUEST['test'].

However I’ve discovered today that there’s a problem with multi-dimension $_REQUEST arrays, and I’m wondering if there’s a way around it.

To test, I used a form with the fields:

<input name="one[one]" />
<input name="one[two]" />
<input name="three[four[five]]" />
<input name="three[four[six]]" />

Once this was submitted, I used var_dump to see the array structure:

array(3) {
  ["one"]=>
  array(2) {
    ["one"]=>
    string(0) ""
    ["two"]=>
    string(0) ""
  }
  ["three"]=>
  array(2) {
    ["four[five"]=>
    string(0) ""
    ["four[six"]=>
    string(0) ""
  }
}

The one element is array-ified as expected. But the three element is not. Now I wouldn’t mind if it just wasn’t supported, but what’s got me confused is the reason why. Look at the names of the sub-elements of three – four[five and four[six. It’s not being interpreted as an array because for some reason the trailing ] which would help to identify these elements as array values has been lost!

Does anyone have an explanation for this? Is there any way around it, other than to only use a maximum of one level in $_REQUEST arrays?

  • 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-21T20:25:35+00:00Added an answer on May 21, 2026 at 8:25 pm

    Try three[four][five] and three[four][six] instead.

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

Sidebar

Related Questions

The MySQLi feature of PHP is great. Prepared Statements are great for injecting parameters
in C# 3, initializers were added. This is a great feature. However, one thing
One great feature of Microsoft Outlook is its spacebar reading mode (with the reading
I'm newbie to lambdaj. It seems that a great feature for Java programming. So
I'm trying to use the i18n feature of simple form, which works great in
I've got a great MS Outlook 2003 addin going that adds some features to
Is it possible to make a PHP application think that the server datetime is
I have several finished, older PHP projects with a lot of includes that I
NetBeans has some great features in it like auto-generating code. However there are some
I'm trying to design a feature in my webpage that sends data somehow to

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.