Join the Stack Overflow Community
Stack Overflow is a community of 6.6 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

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);
?>   
share|improve this question

marked as duplicate by chris85, Vural Acar, Rizier123 php Oct 8 '16 at 19:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
You're missing a semicolon after setting the $startvariable value. – Te Ko Oct 8 '16 at 19:33
    
You just looked at that specific error now, but you probably also want to look at how to solve syntax errors in general: stackoverflow.com/a/18050072/3933332 – Rizier123 Oct 8 '16 at 19:55
$start = "http://example.com"

you are missing ";"

share|improve this answer
    
Simple question, simpe answer, but it helped me! :) – Pedro Jan 15 at 12:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.