doupiai5597 2013-03-28 22:17
浏览 39

如果我不希望我的输出完全搞砸了,我是否真的需要在脚本中写入的每个PHP语句中添加“ ”?

I'm learning PHP and writing it and executing in the browser is cumbersome. So I write it as a script and execute it on the terminal, such as

me@machine $ php script.php

However, it seems to me, all statements are printed to the same line, if not explicitly a newline character is also printed.

<?php
echo "Hello World.
";
?>

If I omit , I end up with

me@machine $ php hello_world.php
Hello World. > me@machine $

which kind of is lame.

Do I really, like really really (as in "totally really"), need to type for every statement I like to test?

  • 写回答

4条回答 默认 最新

  • douzuo5504 2013-03-28 22:19
    关注

    Yes, you need to use to print a new line.

    PHP will only print that which you tell it to print. So, if you want a new line then you need to print a new line.

    评论

报告相同问题?

悬赏问题

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