doubinchou4219 2012-03-24 21:58
浏览 89
已采纳

PHP:如何在控制台中隐藏<br />

Okay, so I've got a program that converts nl2br, and prints the output to a console window. Though it prints along with the output data, the <br />. I'm fine with it and all, if I can't remove/hide it without all the output melding together, but I'd rather hide/remove it if possible. Any suggestions are thankfully accepted.

-Example- What console says:
: Output here!<br />
What I want:
: Output here!

I've tried substr($out, 5), trim(), and that's all I could come up with. All those did was meld the output together.

  • 写回答

2条回答 默认 最新

  • dongshuo1856 2012-03-24 22:05
    关注

    It's not totally clear, but I suspect you misuderstood nl2br. As the name suggests, it adds for each "newline" a "br" before, so that in HTML (which treats newlines like spaces in text) you will see actualy the text continuing in the next line. When you print to console, the console interprets usually the newline as a newline and so a new line begins. You do not have to use nl2br if you want to output "it" to console. (See nl2br for details).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度