我想在$content
字符串下面找到http://www.facebook.com但它不返回任何东西。请指导。谢谢。函数strpos()不返回任何东西
<?php
$content = file_get_contents('http://graph.facebook.com/4');
$url = 'http://www.facebook.com';
$pos = strpos($content, $url); //find position of url in string
echo $pos;
它可能无法在$ content中找到变量$ url。因此'strpos'会返回'FALSE'并且什么也不回应。 – neeagl
为什么颠倒顺序? –
在失败时测试布尔值“false” –