在textarea輸入框里面chr(13)是代表回車,但當(dāng)我替換時(shí)確實(shí)可以我要的字符,但是他顯示時(shí)回車的地方就會有一個(gè)空格,經(jīng)過反復(fù)調(diào)試是有一個(gè)n,這個(gè)應(yīng)該是數(shù)據(jù)庫或程序的回車符吧。
- <form name="form1" method="post" action="">
- <p>
- <label for="textarea"></label>
- <textarea name="textarea" id="textarea" cols="45" rows="5"></textarea>
- </p>
- <p>
- <input type="submit" name="button" id="button" value="提交">
- </p>
- </form>
- <?
- if( $_post )
- {
- $textarea = str_replace("n",'',str_replace(chr(13),'',$_post['textarea']));
- echo $textarea;
- }
- ?>
新聞熱點(diǎn)
疑難解答