Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your Heredoc needs a little modification (because it's actually Nowdoc!):</p> <pre><code> echo &lt;&lt;&lt;EX &lt;p&gt;Game: {$data['game_name']}&lt;br/&gt; the owner of the game is {$data['game_owner']} &lt;/p&gt; EX; </code></pre> <ul> <li>Heredoc identifiers (unlike nowdoc ones) cannot be quoted. <code>'EX'</code> needs to become <code>EX</code>.</li> <li><p>The Heredoc terminator <em>must not</em> have any preceding whitespace. From the docs:</p> <blockquote> <p>It is very important to note that the line with the closing identifier must contain no other characters, except possibly a semicolon (;).</p> </blockquote> <p>You're confusing Nowdoc with Heredoc.</p></li> <li>Complex data types in strings must be surrounded by <code>{}</code> for them to be parsed as variables. For example, <code>$data['game_name']</code> should be <code>{$data['game_name']}</code>. </li> </ul> <p>You're mixing up heredoc and nowdoc here. You want to use <strong>Heredoc</strong> and <em>not</em> Nowdoc because you've got variables inside your string. Heredocs are "extended" double quoted strings, whereas nowdocs are more akin to a single quoted string, in that variables are not parsed in nowdoc strings, but are in heredoc.</p> <ul> <li>More on Heredoc <a href="http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc" rel="nofollow noreferrer">here</a>.</li> <li>More on Nowdoc <a href="http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc" rel="nofollow noreferrer">here</a>.</li> </ul> <p>Please read the documentation more carefully on these.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload