W3docs

PHP using Gettext inside <<<EOF string

It is possible to use the gettext function inside a heredoc string in PHP.

It is possible to use the gettext function inside a heredoc string in PHP. A heredoc string is a string that is defined using the <<<EOF syntax.

Here is an example of how you can use gettext inside a heredoc string:

Example of using Gettext inside <<<EOF string in PHP

php— editable, runs on the server

<div class="alert alert-info flex not-prose"> Watch a course <span class="hidden md:block">Watch a video course </span> Learn object oriented PHP</div>

To use gettext inside a heredoc string, you can simply call the gettext function like you would anywhere else in your code.

For example:

Example of using gettext function inside a heredoc string in PHP

php— editable, runs on the server