我的问题是我不明白为什么它实际上不起作用?我也是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");
?>
答案 0 :(得分:1)
你必须在&amp; 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");
?>