开发者

Echo an $_POST in PHP

开发者 https://www.devze.com 2023-01-02 14:53 出处:网络
How can I print a $_P开发者_如何转开发OST? Example: echo $_POST[\'data\']; This returns nothing...You can also wrap your code with <pre> tags to make your array prints out nicer instead of j

How can I print a $_P开发者_如何转开发OST?

Example:

echo $_POST['data'];

This returns nothing...


You can also wrap your code with <pre> tags to make your array prints out nicer instead of just 1 continuous line. A trick that was shown by a member on this site.

<pre>
<?php var_dump($_POST); ?>
</pre>


Your code is correct.

You can use either:

var_dump($_POST);

or

print_r($_POST);

to print out the entire POST array for debugging.


You can only show the values of keys that exist. array_keys() returns an array containing the keys that exist in the array. If there is no output for a key despite the fact that the key exists then the array may contain an empty value for that key.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号