I'm trying to use an <input type="image"> tag, but
the <<< |
How do I create arrays in a HTML <form>? | How do I get all the results from a select multiple HTML tag? >>> |
10.8 PHP and HTML 10 FAQ : Foire Aux Questions Manuel PHP . What encoding/decoding do I need when I pass a value through a form/URL? . I'm trying to use an <input type="image"> tag, but the ->How do I create arrays in a HTML <form>? . How do I get all the results from a select multiple HTML tag? . How can I pass a variable from Javascript to PHP? |
10.8.3 How do I create arrays in a HTML <form>?
To get your <form> result sent as an array to your PHP script you name the <input>, <select> or <textarea> elements like this:
Notice the square brackets after the variable name, that's what
makes it an array. You can group the elements into different arrays
by assigning the same name to different elements:
This produces two arrays, MyArray and MyOtherArray, that gets sent
to the PHP script. It's also possible to assign specific keys
to your arrays:
The AnotherArray array will now contain the keys 0, 1, email and phone.
See also Array Functions and Variables from outside PHP . |
<< | How do I create arrays in a HTML <form>? | >> |
I'm trying to use an <input type="image"> tag, but the | PHP and HTML | How do I get all the results from a select multiple HTML tag? |