Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mxramirez011's avatar

How to output raw curly braces

I know that blade uses {{ $var }} to render string variables. But I want to print to screen double curly braces.

I want something like that: {{ '{{' . $var . '}}' }}.

How can I achieve it?

0 likes
4 replies
rin4ik's avatar

Use HTML entities

{{ '{{' . $var . '}}' }}

or Just add the @ symbol before the curly braces.

@{{ This is displayed WITH the braces on each side }}
mxramirez011's avatar

The first

{{ '{{' . $var . '}}' }}

throw an

ErrorException (E_ERROR)
Parse error: syntax error, unexpected '}', expecting ',' or ')'

The second

@{{ This is displayed WITH the braces on each side }}

You cannot output any variable.

Please or to participate in this conversation.