Home >Backend Development >PHP Tutorial >PHP method to get the array passed from the HTML form_PHP tutorial

PHP method to get the array passed from the HTML form_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:01:34826browse

php method to get the array passed from the html form

This article mainly introduces the method of php to get the array passed from the html form, and analyzes the techniques of php operating form elements with examples. It is of great practical value, friends in need can refer to it

The example in this article describes how PHP obtains the array passed from the HTML form. Share it with everyone for your reference. The details are as follows:

Set the name of each element of the form to the same array object to pass the form value in the form of an array

The html page is as follows:

?

1

2

3

4

5

6

7

8

9

10

1 2

3

4

5

6

1

2

3

4

5

6

$postedtags = $_POST['tags'];

foreach ($postedtags as $tag){

echo "
$tag";

}

?>

7 8

9 10

arrayformdata.php page is as follows: ?
1 2 3 4 5 6 <🎜>$postedtags = $_POST['tags'];<🎜> <🎜>foreach ($postedtags as $tag){<🎜> <🎜>echo "
$tag"; } ?>
I hope this article will be helpful to everyone’s PHP programming design. http://www.bkjia.com/PHPjc/971943.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/971943.htmlTechArticlephp method to get the array passed from the html form. This article mainly introduces the method of php to get the array passed from the html form. , the example analyzes the skills of operating form elements in PHP, which is very practical...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn