dongle0396 2017-12-09 22:05
浏览 121

textarea开头的额外空格[重复]

This question already has an answer here:

I have some data in database and want allow user to edit a field like description of product and sometimes it might be long to I wanna put already existing value into textarea so the user will already have old description in textarea and just add or delete some text. The problem is that I have some additional whitespaces at beginning and end of textarea even though there is no whitespace in this text I even echo that variable to make sure there is no space. I even trim my variable to remove it but it doesn't change anything.

It looks like that: https://i.imgur.com/2LY9Aev.png

I want to get rid of these whitespaces

Html code:

<textarea cols="50" rows="5" name="text">
                            <?php 
                            $info = trim($row['description']);
                            echo $info;?>
                            </textarea>

Php code:

$sql = "SELECT * FROM shops WHERE id_shop = '$id_shop'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
</div>
  • 写回答

2条回答 默认 最新

  • dongyata3336 2017-12-09 22:11
    关注

    there is lots of spaces before

                            <?php 
    

    e.q. many spaces then < ? php ...

    评论

报告相同问题?

悬赏问题

  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表