2012-10-25 27 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" 

當然,按回車創建上述多輸入。