简体   繁体   中英

Echoing html and $_POST

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

Hi can anyone 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.

这样做:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM