<form name="form1" method="post" action="test2.php">
<input type="checkbox" name="checkbox1">
<input type="text" name="textbox1">
<input type="submit" name="submit">
</form>
<?php
echo print_r($_POST);
?>
The code shows Array () 1
or Array ( [checkbox1] => on [textbox1] => asf [submit] => submit ) 1
.
I don't understand why does the array always follows the number 1
.
When I change POST
method to GET
method, the same thing happen.
When I use another Array to store the value of $_POST
, the same thing happen again!
<?php
$temp = $_POST;
if (isset($_POST['textbox1']))
$temp = "textbox1='{$temp['textbox1']}'";
textbox1='asdf'1
Array ( [textbox1] => asdf [submit] => submit) 1
?>