Receive and manipulate array in form post data
Arrays can be passed from a html web form to a php script. The ‘name’ attribute of the input type should be specified as an array.
example :
<form method="post" action="arrayformdata.php"> <label>Tags</label> <input type="text" name="tags[]"/> <input type="text" name="tags[]"/> <input type="text" name="tags[]"/> <input type="text" name="tags[]"/> <input type="text" name="tags[]"/> <input type="submit" value="submit"> </form> </html> To receive the array in a php script, we use the $_POST as <pre lang="php"> <?php $postedtags = $_POST['tags']; foreach ($postedtags as $tag){ echo "<br />$tag"; } ?>
More From ashesh
- Removing a directory in php with rmdir() | Nepali Calendar | Nepali Unicode | Ashesh
- Creating directories in php with mkdir() | Nepali Calendar | Nepali Unicode | Ashesh
- Upside Down House in Germany | Nepali Calendar | Nepali Unicode | Ashesh
ashesh Recommends
- How to Install and Uninstall Fonts in Windows (iPad 2 News)
- Google and Samsung to unveil Nexus Prime in October | Computechgadgets.com (Sathiya seelan)

