PHP Question: Post Variables
Friday, July 29, 2011 - 18:10
Question
Take the following HTML form.
1 2 3 4 | <form id="form" name="form" method="post"> <input type="text" name="number" value="0" /> <input type="submit" /> </form> |
What is the output of the following PHP code after the above form has been submitted, and why?
1 2 3 4 5 | if ($_POST['number'] === 0) { echo 'number is zero'; } else { echo 'number is not zero'; } |