PHP If Statement if (!$_POST)
- What does !$_POST
mean?
For instance, in some legacy code I'm looking at, the code reads:
<form action="paypalorders.php" method="POST">
<input type="hidden" name="orderList" value="' . $orderList . '">
<input type="submit" value="Archive">
</form>';
if (!$_POST) {
file_put_contents('/orders.txt', $output_line1);
}
I've looked at a bunch of other threads and haven't seen this exact question asked, so I'm trying to find out what it is. I've seen threads that format it like this:
if(!empty($_POST)) {
But not quite the same as what I'm looking for. Is it the same thing, just shorthand? I'm not sure, which is why I'm asking. I've Googled around and looked at a handful of threads and I'm still not sure.
Thank you.