title: php : echo"", print(), printf()
body: <p>Is there a better way to output data to html page with PHP?</p>
  
  <p>If I like to make a div with some var in php, I will write something like that</p>
  
  <pre><code>print ('&lt;div&gt;'.$var.'&lt;/div&gt;');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>echo "'&lt;div&gt;'.$var.'&lt;/div&gt;'";
  </code></pre>
  
  <p>What is the proper way to do that?</p>
  
  <p>Or a better way, fill a <code>$tempvar</code> and print it once? like that:</p>
  
  <pre><code>$tempvar = '&lt;div&gt;'.$var.'&lt;/div&gt;'
  print ($tempvar);
  </code></pre>
  
  <p>In fact, in real life, the var will be fill with much more!</p>