Echo $ _POST in PHP

How can i print $_POST?

Example:

echo $_POST['data'];

This does not return anything ...

+5
source share
3 answers

You can also wrap your code with tags <pre>to print an array better than 1 continuous line. The trick that was shown by the participant on this site.

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

The correct code.

You can use either:

var_dump($_POST);

or

print_r($_POST);

to print the entire POST array for debugging.

+5
source

. array_keys() , , . , , , .

+1

All Articles