what does comma in echo statement signify?

后端 未结 2 1542
误落风尘
误落风尘 2021-01-14 15:50

I am trying to echo a string from a Recursive function:
echo \"

  • \", $node, recurse($arr), \"
  • \";
    and
    echo \"
  • \" .
  • 2条回答
    •  清歌不尽
      2021-01-14 16:42

      echo is a language construct and can accept multiple arguments separated by a comma. The effect is identical to a concatenated string.

      The output shouldn't be different - I can't think of an instance where it could be.

      Edit: Ah, but it is. That is because your function echo()es stuff. In the first instance,

    • and $node get output; then the function's output comes.

      I would have WriteList simply return values recursively.

    提交回复
    热议问题