Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 $html 中搜索这些确切的词“$2.99 Buy”,并在找到时返回正数?如果它区分大小写,它也会有所帮助。
我的目标是检查 iTunes,看看当前选择的书是否仍然是 2.99 美元
<?php $html = file_get_contents ($urlonitunes); echo $html;?>
使用strpos():
strpos()
if(strpos($html, '$2.99 Buy') !== FALSE) { echo 'found'; }