What is <<<_END?

前端 未结 5 1363
生来不讨喜
生来不讨喜 2021-01-04 08:45

I\'m new to PHP and don\'t understand what the point of <<<_END is. Could someone please explain when this should be used? I\'ve looked at various exam

5条回答
  •  难免孤独
    2021-01-04 09:17

    It's the start of a heredoc. you can do:

    $data = <<< _END
    
    You can write anything you want in between the start and end
    
    _END;
    

    _END can be just about anything. You could put EOF or STUFF. as long as you use the same thing at the start and the finish.

提交回复
热议问题