Answer the question
In order to leave comments, you need to log in
Pass 0 in POST request
As you know (well, or not everyone knows, I don’t know), when trying to send the number 0 or a string consisting of zeros via POST to PHP, we will not receive anything on the server side, because anything == FALSE in post is truncated.
But this is very necessary!
Who solves this problem?
Answer the question
In order to leave comments, you need to log in
Parse your host. Maybe you are using a framework that runs all the data through empty and removes, in his opinion, unnecessary.
PHP doesn't do that.
don't use the stupid
if ($_POST["x"]) construct...
and you'll be happy if you
stepped on this rake yourself :)
Using this method is not justified in your case, but, for general development:
file_get_contents( 'php://input' )
- will return the entire POST as it is. If the POST contains form data, then parse_str() can be used next.
But, in answer to your question, I join the opinion that the problem is not created by PHP, but by you. :)
Everything is perfectly transmitted pix.am/uPe0/
In general, sometimes a method of cleaning data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question