-3

我的问题是我不明白为什么它实际上不起作用?我也是 php 新手,所以我正在学习这个 PHP。我不知道为什么它是一个意外的 T_VARIABLE 我假设它的意思是“ $ ”

<?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("\r\n", $dump));
   die(count($dump).' ids were dumped into the list.'."\n");
?>
4

1 回答 1

1

你必须放分号 ; &mode=1'之后 像:

$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("\r\n", $dump));
die(count($dump).' ids were dumped into the list.'."\n");
?>
于 2013-09-21T07:48:32.973 回答