Home  >  Article  >  Backend Development  >  What is the "<<<" operator in laravel?

What is the "<<<" operator in laravel?

WBOY
WBOYOriginal
2016-09-05 08:59:561247browse

I checked PHP, it’s a bit similar to bitwise operators, but judging from the example code, it should return HTML nodes.
For example:

<code>$form = <<<FORM
        <form action="form_test" method="POST">
            <input type="hidden" name="_token" value="{$csrf_token}">
            <input type="submit" value="Test"/>
        </form>
FORM;</code>

However, FORM can be replaced by GET, and strangely, the variable $csrf_token can be used in value, but the function csrf_token() cannot be used directly
I am a little confused.

Reply content:

I checked PHP, it’s a bit similar to bitwise operators, but judging from the example code, it should return HTML nodes.
For example:

<code>$form = <<<FORM
        <form action="form_test" method="POST">
            <input type="hidden" name="_token" value="{$csrf_token}">
            <input type="submit" value="Test"/>
        </form>
FORM;</code>

However, FORM can be replaced by GET, and strangely, the variable $csrf_token can be used in value, but the function csrf_token() cannot be used directly
I am a little confused.

This is the Heredoc structure of php, it has nothing to do with the framework

http://php.net/manual/zh/lang...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn