How do I take multiple typed data and save to a php array

Asked

Viewed 29 times

-1

How do I take several typed data from an html text box and then launch it into a PHP array

1 answer

-1


Follows the code:

<form action="" method="POST">
    <input type="text" name="texto[]">
    <input type="text" name="texto[]">
    <input type="text" name="texto[]">
    <input type="text" name="texto[]">
    <input type="submit" name="submit">
</form>

<?php
if (isset($_POST['submit'])) {

print_r($_POST['texto']);

}
?>

You use the <input name="valor[]"> The "[]" serves to transform the input into an array :)

Doubt taken by @SAM no post: Help to send jQuery cloned inputs to the database

Browser other questions tagged

You are not signed in. Login or sign up in order to post.