-2

I am getting an error on this:

<?php
$homepage = file_get_contents('http://segeco.me/lol.txt');
if ($homepage == ('loll')) then
echo $homepage;
?>

ERROR: Parse error: syntax error, unexpected 'echo' (T_ECHO) in /home/bluesnow/public_html/dog.php on line 5

(The code is not php, Just an example.)

Segeco
  • 45
  • 5

1 Answers1

0

Your error was in if($homepage== ('loll')) then

You should do:

if($a == $b){
echo $a;
}
else{
echo "nope...";
}

Full example:

$first = file_get_contents('http://www.example.com');
$second = file_get_contents('http://www.wikipedia.org');

if($first == $second){
echo $first;
}


else{
    echo $second;
}
MrK
  • 1,060
  • 9
  • 23