title: PHP echo easy problem ;)
body: <p>Ok, it's Wordpress related and I know about Wordpress Stack Exchange, but I'm asking here because this is mostly a PHP question.</p>
  
  <p>I want my code to display something or nothing using if statement.</p>
  
  <p>The problem is I'm going to have a variable and bloginfo('template_directory') in-bulit function.</p>
  
  <p>I wrote this:</p>
  
  <pre><code>    &lt;?php if (!empty($instance['example'])) 
  
      echo "&lt;li&gt;&lt;a href=". $example ."&gt;&lt;img src="?&gt;&lt;?php bloginfo('template_directory') ?&gt;&lt;?php echo "/images/example.png /&gt;&lt;/a&gt;&lt;/li&gt;"; ?&gt;   
  </code></pre>
  
  <p>It works fine until $instance['example'] is not empty, when is - it still displays the template directory link including images/example.png.</p>
  
  <p>Any ideas?</p>
  
  <p>I've tried " . bloginfo('template_directory') . " but doesn't seem to work.</p>