开发者

Echoing html and $_POST

开发者 https://www.devze.com 2023-01-22 01:22 出处:网络
echo \"<p id=\'xlday\'>\'$_POST[\'day\']\'</p>\"; Hi can anyo开发者_运维问答ne help me solve this problem, should be a simple one but i\'m struggling for some reason!
echo "<p id='xlday'>'$_POST['day']'</p>";

Hi can anyo开发者_运维问答ne help me solve this problem, should be a simple one but i'm struggling for some reason! Thanks


echo "<p id='xlday'>".$_POST['day']."</p>";


echo "<p id='xlday'>".$_POST['day']."</p>";

or

echo "<p id='xlday'>{$_POST['day']}</p>";

or

echo "<p id='xlday'>${_POST['day']}</p>";

or

echo "<p id='xlday'>$_POST[day]</p>";



I'll also add

echo "<p id='xlday'>", $_POST['day'], "</p>";

with the mention that it does not actually concatenate the strings, but rather outputs them one at a time.


Do like this:

echo "<p id='xlday'>".$_POST['day']."</p>";


You can also do like:

echo "{$_REQUEST['day']}

";

However we prefer output buffering.

http://www.suite101.com/content/output-buffer-in-php-a26768

0

精彩评论

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