LakshyaK2011 在這里。我正在用 Html 制作一個表單,并且該表單<textarea>中有一個標簽。first.php 就像:
<form method="post" action="next.php">
<textarea name="desc" raws="4">Here, Its Text Area</textarea>
<button type="submit" name="submit">NEXT BUTTON</button>
</form>
而 next.php 就像:
<?php
if(isset($_POST["submit"]))
{
$desc = $_POST["desc"];
echo $desc; //<------ ECHO LINE 1
}
else
{
header("location: first.php");
}
當我輸入此訊息時:
Hi,
Helo There,
I Am LakshyaK2011.
并在它的 next.php 中回顯,在 ECHO LINE 1 中(參見在 next.php 的代碼中)
它顯示如下:
Hi, Helo There, I Am LakshyaK2011.
有什么解決辦法嗎?謝謝,
我試過了:(
我不知道該怎么做,所以我什么都沒試過)
我期待:
我將進入:
Hi,
Helo There,
I Am LakshyaK2011.
它會列印一樣的。
不喜歡:
Hi, Helo There, I Am LakshyaK2011.
uj5u.com熱心網友回復:
要以 HTML 格式顯示新行,您需要諸如<br>
所以改變
echo $desc;
至
echo str_replace(chr(13), '<br>',$desc);
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/531962.html
標籤:phphtml形式
下一篇:將變數傳遞給with()的問題
