Epic-jargon
Epic-jargon

Reputation: 53

php html Fatal error: Maximum execution time of 30 seconds exceeded

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);

Upvotes: 0

Views: 238

Answers (1)

Jonathan Crowe
Jonathan Crowe

Reputation: 5803

You are assigning $check = true instead of comparing the two values. Turn

while($check = true)

to

while ($check === true)

Upvotes: 3

Related Questions