How 开发者_JAVA百科do I output several lines of the $_POST
variable ?
$_POST
variable
Thanks for helping If you want more detailed information about what's being stored in $_POST
you can use
var_dump($_POST);
This will return the key, contents and type of each entry
print_r($_POST);
This will display the key and contents of each entry.
If you want to cycle through the contents of $_POST
and format the output you can use.
foreach($_POST as $key => $value){
print $key.' is '.$value.'<br />';
}
What do you mean by "the last $_POST variable"? Please provide the code snipped and the desired output format.
echo $_POST; -> "Array" print_r ($_POST); -> detailed output of the array's contents.
You mean something like this?
foreach ($_POST as $key => $value)
{
echo $key . ': ' . $value . '<br />';
}
精彩评论