i feel this is going to be something stupid but i cant seem to get this to work what im trying to do is read through a file and extract all the appropriate web addresses but when i run this i get a fatal error, i get the feeling im initiating an infinate loop but i cant find it
$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);
You are assigning $check = true instead of comparing the two values. Turn
while($check = true)
to
while ($check === true)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.