Search
 
SCRIPT & CODE EXAMPLE
 

HTML

array in html form

You can also post multiple inputs with the same name and have them save into an array by adding empty square brackets to the input name like this:

<input type="text" name="comment[]" value="comment1"/>
<input type="text" name="comment[]" value="comment2"/>
<input type="text" name="comment[]" value="comment3"/>
<input type="text" name="comment[]" value="comment4"/>
If you use php:

print_r($_POST['comment']) 
you will get this:

Array ( [0] => 'comment1' [1] => 'comment2' [2] => 'comment3' [3] => 'comment4' )
Comment

PREVIOUS NEXT
Code Example
Html :: img srcset 
Html :: how to set canvas on background html 
Html :: html code for writing text 
Html :: amp-img example 
Html :: how to add an svg image to html 
Html :: accept vedio pdf files upload html 
Html :: html js script 
Html :: html clickable image 
Html :: how to add text on top of an image 
Html :: html + sign 
Html :: view html file linux terminal 
Html :: inserting a page break in markdown 
Html :: em tag in html5 
Html :: on page load animation 
Html :: how to make an a tag not clickable 
Html :: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size. 
Html :: html how to start a page 
Html :: auto update time in html 
Html :: vuejs v-on 
Html :: link react to html 
Html :: socket io script 
Html :: how to add bar notation in html 
Html :: how to stop marquee text in html when you hover over it 
Html :: how to detect play button on html video player 
Html :: how to make email required in html 
Html :: converting HTML table to image 
Html :: input type checkbox and hide checkbox 
Html :: html include html page 
Html :: how to make a class in html 
Html :: Tailwind CSS timeline 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =