title: Not able to use if statement with dompdf
body: <p>This is my code:</p>
  
  <pre><code>&lt;?php
  $root = realpath($_SERVER["DOCUMENT_ROOT"]);
  include "$root/config.php";
  require_once 'dompdf/autoload.inc.php';
  use Dompdf\Dompdf;
  $dompdf = new Dompdf();
  
  $stmt = $pdo-&gt;prepare('SELECT name FROM my_table');
  $stmt-&gt;execute();
  
  $results = $stmt-&gt;fetchAll();
  foreach( $results as $row ) {
  $dompdf = new DOMPDF();
  
  $html = "
  
  ".if(!empty($row['name']))  {
  echo "My name is".$row['name']."";
  }."
  
  ";
  
  $dompdf-&gt;load_html($html);
  }
  $dompdf-&gt;setPaper('A4', 'portrait');
  $dompdf-&gt;render();
  $dompdf-&gt;stream();
  ?&gt;
  </code></pre>
  
  <p>I'm always getting: </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected 'if' (T_IF) in
    /var/www/user_name/html/create_pdf.php on line 17</p>
  </blockquote>
  
  <p>Simple HTML code like this <code>$html = "&lt;p&gt;Hello, it's me!&lt;/p&gt;";</code> works.</p>
  
  <p>Also PHP code like this <code>$html = "My name is ".$row['name']."!";</code> works.</p>
  
  <p>Just the if-statement seems not to work.</p>
  
  <p>What am I doing wrong?</p>