Parse Error: Syntax Error,whitespace error

I get a error like

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)

for the below code..

$string="<b style=margin-left:30px;font-size:12px;font-weight:bold>"."< a href='tracklocation.php?deviceid=<?=$row['device_id']?>&vno=<?=$row['vehicle_no']?>'>". $row['vehicle_no']."</br>  ";

this should do it

$string="<b style=margin-left:30px;font-size:12px;font-weight:bold>"."<a href='tracklocation.php?deviceid={$row['device_id']}&vno={$row['vehicle_no']}'>". $row['vehicle_no']."</a></br>";

please notice that instead of using <?= $variable ?> if used {$variable} to escape parsing the varibale as a string, if you insisted on using <?= $variable ?> then you should use <?= echo $variable; ?> <?= echo $variable; ?>

链接地址: http://www.djcxy.com/p/69936.html

上一篇: 如何解决“意外的T

下一篇: 解析错误:语法错误,空白错误