开发者

How do you output several lines of the $_POST variable

开发者 https://www.devze.com 2023-02-04 00:39 出处:网络
How 开发者_JAVA百科do I output several lines of the $_POST variable ? When I keep outputting the result I only get the last $_POST variable

How 开发者_JAVA百科do I output several lines of the $_POST variable ?

When I keep outputting the result I only get the last $_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 />';
}
0

精彩评论

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