4

我可以这样:

php>multline start; 
.... $a =<<< EOF 
.... hello hi how are you this is phpSH 
.... hello there its test line 
.... EOF; 
.... multiline end; 

在 phpsh 中?

4

2 回答 2

0

举个例子,if 多行语句:

  1. 类型:如果(条件){
  2. 只需按 Enter
  3. ...并写下你想要的。
  4. } 关闭多行语句。并按 Enter 执行它。

您可以通过按 ctrl + c 进一步取消写入。

于 2015-02-20T02:40:57.863 回答
0

也许就像这样:

php> $test = "
 ... hello hi how are you this is phpSH
 ... hello there its test line
 ... "
    <the_empty_result>
php>
php> echo $test

hello hi how are you this is phpSH
hello there its test line

php>
php> =$test
"\nhello hi how are you this is phpSH\nhello there its test line\n"

或者

php> $test = "hello hi how are you this is phpSH
 ... hello there its test line"
    <the_empty_result>
php>
php> echo $test
hello hi how are you this is phpSH
hello there its test line
php>
php> =$test
"hello hi how are you this is phpSH\nhello there its test line"

当然,按Enter创建上面的多行输入。

于 2015-03-05T11:51:14.733 回答