Maybe the code looks like something like this:
foreach(...$POST){ echo $key."<br/>; } var_dump($_POST); or
print_r($_POST); You might insert a pre tag before and after for the clearer output in your browser:
echo '<pre>'; var_dump($_POST); echo '</pre>'; And I suggest to use Xdebug. It provides an enchanted var_dump that works without pre's as well.
<pre>...</pre> tags around it for better formatting.array_keys() will do it.See the PHP documentation on foreach: http://php.net/manual/en/control-structures.foreach.php
Your code would look something like this:
foreach ($_POST as $key=>$element) { echo $key."<br/>"; } $array = array_flip($array); echo implode('any glue between array keys',$array); Or you could just print out the array keys:
foreach (array_keys($_POST) as $key) { echo "$key<br/>\n"; } Normally I would use print_r($_POST).
If using within an HTML page, it's probably worth wrapping in a <pre> tag to get a better looking output, otherwise the useful tabs and line breaks only appear in source view.