title: Simple PHP switch case changing output... What am i doing wrong?
body: <p><strong>Main Question:</strong>
  <em>Does an echo output differently inside a switch than on its own?</em></p>
  
  <p>--</p>
  
  <p>I don't think this is anything too involved, but it's certainly causing a little bit of headache for me!</p>
  
  <p>To start with something simple, I'm able to show the Joomla full article image like this:</p>
  
  <pre><code>&lt;img src="&lt;?php echo htmlspecialchars($images-&gt;image_fulltext); ?&gt;" /&gt;
  </code></pre>
  
  <p>I then wanted to expand this, and add a lightbox to the image, which turned into this:</p>
  
  <pre><code>&lt;a href="&lt;?php echo htmlspecialchars($images-&gt;image_fulltext); ?&gt;" data-lightbox="image"&gt;
      &lt;img src="&lt;?php echo htmlspecialchars($images-&gt;image_fulltext); ?&gt;" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>The lightbox works fine.</p>
  
  <p>However, then I only wanted this lightbox to apply to certain menu IDs (I have a News section in multiple languages, and so want to only apply the hyperlinks when certain pageIDs were being viewed).</p>
  
  <p>I decided to make a switch (simple enough!)</p>
  
  <pre><code>&lt;?php
  $app = JFactory::getApplication();
  $menuID = $app-&gt;getMenu()-&gt;getActive()-&gt;id;
  
  switch ($menuID) {
      case '168':
      case '231':
          echo
          "&lt;a href='".htmlspecialchars($images-&gt;image_fulltext)."' data-lightbox='image'&gt;
          &lt;img src='".htmlspecialchars($images-&gt;image_fulltext)."' /&gt;
          &lt;/a&gt;";
      break;
  
      default:
          echo
          "&lt;img src='".htmlspecialchars($images-&gt;image_fulltext)."' /&gt;";
      break;
  }
  ?&gt;
  </code></pre>
  
  <p>The problem is that the switch is changing the output of src.</p>
  
  <p><strong>Outside of switch:</strong> /armouredshielding/images/news-events/website-screenshot.jpg</p>
  
  <p><strong>Inside switch:</strong> images/news-events/website-screenshot.jpg</p>
  
  <p>surely this isn't the way switches work is it? It's still using an echo command, so the output should be exactly the same?</p>
  
  <p>Any help is greatly appreciated!</p>