Okay, I give up. Here's a solution with preg_match_all() instead:
<?php
$search_uri = "http://www.example.com";
$content = "<!-- hello --> $search_uri <!-- goodbye -->";
if (preg_match_all('#\<\!\-\-(.*?)\-\-\>#si', $content, $matches)) {
$found = false;
foreach ($matches[1] as $string) {
if (strpos($string, $search_uri) !== false) {
$found = true;
break;
}
}
echo '"' . $search_uri . '"';
if ($found) {
echo ' is commented out';
} else {
echo ' is NOT commented out';
}
} else {
echo 'Content has no comments';
}
?>