以下にこのコードを示しますが、「$text」に「by owner」という単語が含まれているかどうかをどのように判断できるか疑問に思っています。どうすればいいですか?私は周りを見回しましたが、何も見つかりません。
foreach($anchors as $a) {
$i = $i + 1;
$text = $a->nodeValue;
$href = $a->getAttribute('href');
if ($i > 22 && $i < 64 && ($i % 2) == 0) {
//if ($i<80) {
echo "<a href =' ".$href." '>".$text."</a><br/>";
}
// }
//$str = file_get_contents($href);
//$result = (substr_count(strip_tags($str),"ipod"));
//echo ($result);
}