title: How Can I produce meta tag strings in PHP
body: <p>I'd like to produce my meta tag lines in php and then echo them in the  of the page.  I seem to be having problems.  When I echo the variable it actually echo's on screen rather than be contained to view source only like the other meta tags.</p>
  
  <pre><code>$ogmeta = '&amp;lt;meta property="og:type" content="Article" /&amp;gt;';
  </code></pre>
  
  <p>then I was just doing</p>
  
  <pre><code>echo $ogmeta;
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>$ogmeta = htmlspecialchars('&lt;meta property="og:type" content="Article" /&gt;');
  </code></pre>
  
  <p>Each time it echos to screen :(</p>
  
  <p>EDIT:</p>
  
  <p>I found this to work</p>
  
  <pre><code>$ogmeta = '&lt;meta property="og:title" content="'.$title.'" /&gt;'; 
  echo $ogmeta;
  </code></pre>
  
  <p>But I need to have multiple entries for $ogmeta like this:</p>
  
  <pre><code>$ogmeta = '';
  $ogmeta .= '&lt;meta property="og:title" content="'.$title.'" /&gt;';
  $ogmeta .= '&lt;meta property="og:site_name" content="some site" /&gt;';
  $ogmeta .= '&lt;meta property="og:type" content="Article" /&gt;';
  $ogmeta .= '&lt;meta property="og:url" content="'.$which_article.'" /&gt;';
  </code></pre>
  
  <p>When I tried echoing this it all appeared on a single line.  I tried adding a line break
  but that doesnt work.  Any ideas?</p>