class orderCart {
public $idx;
public $orderCart;
public function __construct() {
$this->idx = 0;
}
public function addOrderCart($food_id) {
$this->orderCart[$this->idx]['food_id'] = $food_id;
$this->idx++;
}
}
<?
$_SESSION["name"] = null;
$_SESSION["name"][] = "I Love ThaiCreate 1";
$_SESSION["name"][] = "I Love ThaiCreate 2";
$_SESSION["name"][] = "I Love ThaiCreate 3";
$_SESSION["name"][] = "I Love ThaiCreate 4";
$_SESSION["name"][] = "I Love ThaiCreate 5";
$_SESSION["name"][] = "I Love ThaiCreate 6";
for($i=0;$i<count($_SESSION["name"]);$i++)
{
echo $_SESSION["name"][$i]."<br>";
}
//==========================================//
echo "<hr>";
$arrVar[] = "I Love ThaiCreate 1";
$arrVar[] = "I Love ThaiCreate 2";
$arrVar[] = "I Love ThaiCreate 3";
$arrVar[] = "I Love ThaiCreate 4";
$arrVar[] = "I Love ThaiCreate 5";
$arrVar[] = "I Love ThaiCreate 6";
$_SESSION["strSession"] = $arrVar;
for($i=0;$i<count($_SESSION["strSession"]);$i++)
{
echo $_SESSION["strSession"][$i]."<br>";
}
?>