我正在使用file_get_contents();
网页:检查网页是否含有文本
$file = file_get_contents('http://example.com');
如何检查网页是否含有文本“你好”和“再见”
我正在使用file_get_contents();
网页:检查网页是否含有文本
$file = file_get_contents('http://example.com');
如何检查网页是否含有文本“你好”和“再见”
$file = file_get_contents('http://example.com');
if (strpos($file, 'hello') !== false)
{
echo "Exist..";
}
对不起,请检查以确定您是否在那里或再见? –
$file = file_get_contents('http://example.com');
$exists = (strpos($file, 'hello') !== false) || (strpos($file, 'bye') !== false);
if ($exists !== false) {
print 'Found';
}
对不起,这是否检查,看看你好或者再见? –
是的,它确实检查,看看你好,是否在那里或再见 –
不,我是指哪一个检查 –
可能[检查字符串是否包含特定单词?](http://stackoverflow.com/questions/4366730/check-if-string-contains-specific-words) – piedar