Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Don't use HEREDOC. It's messy, and should only be used when you need to store long strings in a variable. Try writing out the HTML page you expect to be returned as if it was a normal HTML page. Where you need PHP output (a variable, array value, etc.), begin a PHP tag, echo the value, and then end the PHP tag. This is much easier than trying to use heredoc.</p> <pre><code>&lt;div class="box"&gt; &lt;h2&gt;&lt;a href="#" id="remove"&gt;&lt;?php echo $text[0]; ?&gt;&lt;/a&gt; &lt;/h2&gt; &lt;div class="block"&gt; &lt;div style="float:left; width: 35%; margin:5px; padding: 1em; background: white;"&gt; &lt;p&gt;Username: &lt;a id="username"&gt;&lt;?php echo $_SESSION['username']; ?&gt;&lt;/a&gt;&lt;/p&gt; &lt;div style="float:left; width: 30%; margin:5px;"&gt; &lt;p&gt;Level:&lt;br /&gt;Weapon:&lt;br /&gt;Power:&lt;br /&gt;Bullets:&lt;br /&gt;&lt;/p&gt; &lt;/div&gt; &lt;div style="float:right; width: 60%; margin:5px;"&gt; &lt;p&gt;&lt;strong id="level"&gt;empty&lt;/b&gt;&lt;br /&gt;Weapon blabla&lt;br /&gt;2 - 5&lt;br /&gt;3/6&lt;br /&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>If you're worried about line breaks (you shouldn't be), you can add an output handler that removes them.</p> <pre><code>ob_start("clean_linebreaks"); function clean_linebreaks($input) { return str_replace("\n", "", str_replace("\r", "", $input)); } </code></pre> <p>Also, may I suggest using tables instead of floated divs. The level, weapon, and power will be easier to line up with their values if you use a table.</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