我有一个简单的 php 文件,它从 textarea 内的 mysql 数据库显示中获取信息,但是当我从浏览器打开它时,它在 textarea 内文本的开头和结尾显示额外的空间
这是它的样子(数据库文本没有多余的空间)
这就是我检索文本所做的
<textarea name="text" rows="9">
<?php echo $fetchedData['founder_msg']; ?>
</textarea>
我使用简单的 mysql_fetch_array 来检索值 文本保存在数据类型文本的mysql数据库中的founder_msg字段中。
最佳答案
您在格式设置中插入了大量空白。请尝试以下操作:
<textarea name="text" rows="9"><?php
echo trim( $fetchedData['founder_msg'] ); // trim, following comments
?></textarea>
关于php - 从数据库中检索时,Textarea 显示额外的空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10927030/