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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:23:09+00:00 2026-06-14T21:23:09+00:00

suppose the html code snippet of a form is as simple as <form action=’test.php’

  • 0

suppose the html code snippet of a form is as simple as

<form action='test.php' method="post">
<select multiple="multiple" name="fruit">
<option value="apple">Apple</option>
<option value="orange">Orange</option>
<button type="submit"> Enter </button>
</select>
</form>

My Question is what’s the format of $_POST['fruit'] while executing the PHP scripts? It does not looks like an array. Since $_POST['fruit'][0] and $_POST['fruit'][1] does not work for access. I am wondering how to access the submitted 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-06-14T21:23:10+00:00Added an answer on June 14, 2026 at 9:23 pm

    Use var_dump($_POST['fruit']); to see your array structure and how you can access it.

    <form action='test.php' method="post">
    <select name="fruit[]" multiple="multiple">
    <option value="apple">Apple</option>
    <option value="orange">Orange</option>
    </select>
    </form>
    

    With such markup your fruits should be inside $_POST['fruit'] as intended.

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

Sidebar

Related Questions

I have the following html code : <form name=uploadForm action= method=POST enctype=multipart/form-data> <input type=file
Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input
Suppose we have this example: http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html with source code available here: http://code.google.com/p/myandroidwidgets/source/browse/trunk/Phonebook/src/com/abeanie/ How can
I am using jQuery to load a page by AJAX using $.ajax (suppose test.html).
Suppose I have the following HTML: <div id=test> <span style=display:inline;>foo</span> <span style=display:none;>bar</span> <span style=display:inline;>baz</span>
I have a question about the examples in this article: http://code.google.com/appengine/articles/transaction_isolation.html Suppose I put
pretty new to HTML and I was wondering why this snippet of code doesn't
Suppose you have this following code in HTML - <div id=pattern> <span class=a>Content</span> </div>
Suppose I have the following HTML code: <div id=container style=width: 960px> <div id=help_panel style=width:

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.