This question already has an answer here:
I'm following a tutorial for making a web-crawler in PHP, i'm using PHP 7.0.11, all the other questions I've looked at with this error ends with them finding out they have a PHP version below 5.3, I however am using 7.0.11, and haven't found anything about it.
Image of Bash containing PHP version
<?php
$start = "http://example.com"
function follow_links($url) {
$doc = new DOMDocument();
$doc->loadHTML(file_get_contents($url));
$linlist = $doc->getElementsByTagName("a");
foreach ($linklist as $link) {
$l = $link->getAttribute("href");
}
}
follow_links($start);
?>
$start
variable value. – Te Ko Oct 8 '16 at 19:33