我觉得这将是一件愚蠢的事情,但我似乎无法做到这一点。我试图做的是读取一个文件并提取所有合适的网址,但当我运行这个程序时,我遇到了一个致命的错误,我感觉我正在启动一个内定循环,但我找不到它
$contents = file_get_contents("../uploads/bookmarks.html");
$find = 'https://www.example.net/e/';
$i = 0;
do{
if(strpos($contents, $find)){
$check = true;
$contents = strstr($contents,$find);
$temp = explode('"', $contents, 2);
echo $temp[0];
}else{
$check = false;
}
}while($check = true);
您分配的是$check=true,而不是比较这两个值。转动
while($check = true)
至
while ($check === true)