How can I dialplay values of array of objects which is stored into session.
I make like this
//fetch array of countries from db
$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;
then display the values of the session like this
<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>
The error occurs when I display the values of session, any help plz?