“如何调试”;分析错误:语法错误,意外';在PHP中是什么?

“如何调试”;分析错误:语法错误,意外';在PHP中是什么?,php,Php,我得到这个错误: 第41行,解析错误:语法错误,第41行的/home/acompanh/public_html/novosite/vipmin/team/index.php中出现意外的“[” PHP文件: <?php $_SERVER['HTTP_REFERER']; $HTTP_REFERER = ''; $_SERVER['DOCUMENT_ROOT']; $document = ''; $_SERVER['SERVER_NAME']; $server = ''; $_SERVER[

我得到这个错误:

第41行,解析错误:语法错误,第41行的/home/acompanh/public_html/novosite/vipmin/team/index.php中出现意外的“[”

PHP文件:

 <?php
$_SERVER['HTTP_REFERER'];
$HTTP_REFERER = '';
$_SERVER['DOCUMENT_ROOT'];
$document = '';
$_SERVER['SERVER_NAME'];
$server = '';
$_SERVER['SERVER_ADDR'];
$ip = '';
$retorno = 'libera';

if ($retorno != 'libera') {
    echo $retorno;
    exit(  );
}

require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/app.php' );
need_manager(  );
need_auth( 'team' );
$now = '';

if ($_REQUEST['acao'] == 'site') {
    $condition = array( '' . 'end_time > ' . $now );
}

strval( $_GET['team_title'] );
$team_title = '';
strval( $_GET['city_id'] );

if ($city_id) {
    $condition['city_id'] = $city_id;
}


if ($team_title) {
    $condition[] = 'title LIKE \'%' . mysql_escape_string( $team_title ) . '%\'';
}

Table::count( 'team', $condition );
$count = '';
pagestring( $count, 20 )[2];
$pagestring = time(  );
[1];
$offset = ;
[0];
$pagesize = ;
DB::limitquery( 'team', array( 'condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset ) );
$teams = ;
Table::fetch( 'category', Utility::getcolumn( $teams, 'city_id' ) );
$cities = $city_id = ;
DB::limitquery( 'partner', array( 'order' => 'ORDER BY id DESC' ) );
$partners = ;
Utility::optionarray( $partners, 'id', 'title' );
$partners = ;
$selector = 'index';
include( template( 'manage_team_index' ) );
?>

您需要学会调试和阅读自己的代码:

[1];   <--- array shortcut declaration not being assigned anywhere
$offset = ;
          ^---missing value
[0];  <--- array shortcut declaration not being assigned anywhere
$pagesize = ;
           ^---missing value
$teams = ;
         ^--missing value
[1];仅在PHP 5.4及更高版本中可用。将函数的返回值指定给临时变量,然后从中获取值


编辑:乍一看,这段代码完全被破坏了。为什么
[1];
单独在一行上?
$pagesize=;
???

什么是
[1];
意味着要做什么?什么是
页面字符串($count,20)[2]
doing?您正在调用一个函数,取消对数组结果的引用,然后将结果扔掉。更好的标题会吸引更多的注意力,准确的标记也会很有帮助。这个问题与MySQL无关。我想知道是否有人对这段代码进行了搜索和替换,犯了错误,并使其处于损坏状态?array de引用只是在PHP5.4中引入的,你看了整整两眼?天哪,我只需要看半眼。那么,请支持miken多看一眼!呃,我在打电话。这是我的借口,我坚持下去!Marc,我正在一行一行地修正,我在第41行发现了一个错误,我解决了我的问题。Tks很多