2012-10-25 24 views
4

我可以是这样的:如何在phpsh中进行多行输入?

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

在phpsh?

回答

0

让我们举个例子,如果多语句:

  1. 类型:如果(条件){
  2. 只需点击进入
  3. ...写你想要什么。
  4. }关闭多行语句。然后按Enter键执行它。

您可以通过点击ctrl + c进一步取消书写。

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" 

当然,按回车创建上述多输入。