PHP解析错误:语法错误,第13行/root/Desktop/generator/dump.php中的意外T_VARIABLE [重复]

This question already has an answer here:

My question is I don't see why it won't actually work?I am also new to php so I am learning this PHP. I do not know why it is an unexpected T_VARIABLE and I'm assuming it means " $ "

<?php
   include('database.class.php');
   $sql = new Database(NULL);

   $ids = $sql->select('*', '`ids` ORDER BY `UserId` ASC', NULL, NULL, NULL, true, true);

   $dump = array();
   foreach($ids as $index=>$id);
        $dump[] = $id['UserId'].' | REGLINK - http://xat.com/web_gear/chat/register.php?UserId='.$id['UserId'].'&k2='.$id['k2'].'&mode=1'

   $DumpFile= 'ids.txt';

   if(file_exists($DumpFile)) {
        unlink($DumpFile);
   }
   file_put_contents($DumpFile, implode("
", $dump));
   die(count($dump).' ids were dumped into the list.'."
");
?>
</div>

you have to put semicolon ; after &mode=1' like :

$ids = $sql->select('*', '`ids` ORDER BY `UserId` ASC', NULL, NULL, NULL, true, true);

$dump = array();
foreach($ids as $index=>$id);
        $dump[] = $id['UserId'].' | REGLINK - http://xat.com/web_gear/chat/register.php?UserId='.$id['UserId'].'&k2='.$id['k2'].'&mode=1';

$DumpFile= 'ids.txt';

if(file_exists($DumpFile)) {
        unlink($DumpFile);
}
file_put_contents($DumpFile, implode("
", $dump));
die(count($dump).' ids were dumped into the list.'."
");
?>