htmlspcialchars not functioning as I would expect
<p>I have code loading in the titles of some films into the title attribute of their respective thumbnails, this format is thus:</p>

<blockquote>
  <p>Artist Name - 'Song Title'</p>
</blockquote>

<p>I had this code initially:</p>

<pre><code>$return .= "' title='";
$return .=$video['title'];
$return .= "'&gt;";
</code></pre>

<p>Obviously the first single quote was causing the title attribute to end prematurley, so I changed it to:</p>

<pre><code>$return .= "' title='";
$return .= htmlspecialchars($video['title']);
$return .= "'&gt;";
</code></pre>

<p>Which has had not effect at all, all the titles are still ending prematurely.</p>

<p>Am I misunderstanding the htmlspecialchars method?</p>
