【发布时间】:2011-08-08 10:24:28
【问题描述】:
如何拨号播放存储在会话中的对象数组的值。
我是这样的
//从数据库中获取国家/地区数组
$countries = array();
while($row = mysql_fetch_array($result)){
$country = new Country();
$country->setCountryName($row['country_name']);
$country->setCountryNo($row['country_no']);
$country->setCountryZipCode($row['country_zipcode']);
$countries[]=$country;
}
$_SESSION['countries']=$countries;
然后像这样显示会话的值
<select name="countries" id="countries">
<?php foreach ($_SESSION['countries'] as $i=>$country ){?>
<option><?php echo $_SESSION['countries'][$i]=>$country.getCountryName()?></option> //here's the error
<?php
}
?>
</select>
显示会话的值时出现错误,请帮助?
【问题讨论】:
-
解析错误:语法错误,意外的 T_DOUBLE_ARROW,需要 ',' 或 ';'在第 14 行的 C:\AppServ\www\crm\subpages\SearchCustomer.sub.php 中。第 14 行是我打印会话值的地方