php - 从数据库中检索时,Textarea 显示额外的空间?

标签 php mysql html

我有一个简单的 php 文件,它从 textarea 内的 mysql 数据库显示中获取信息,但是当我从浏览器打开它时,它在 textarea 内文本的开头和结尾显示额外的空间

这是它的样子(数据库文本没有多余的空间)
enter image description here

这就是我检索文本所做的

<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/

相关文章:

mysql - Windows Server mysql系统表转换为innodb无法启动

javascript - 在 javascript 中, "new Audio( )"的视频等效项是什么

html - CSS 边距防止区域可点击

javascript - Symfony 和 React 路由器,找不到路由

php - 使用php更新sql数据库

php - 使用存储过程列出记录

html - Firefox 数字宽度/间隔

php - Laravel Eloquent 无法通过 $model->id 访问;

php - 在 SOAP WSDL 调用 PHP 上获取 500 内部服务器错误

PHP mysql jquery 分页修改