Hello guys I just want to ask how can i get the array values within an array? I also used the unserialize function and it returns to array. That's why I got a lists of array.
Here's my sample output for the array:
Array
(
[0] => Array
(
[id] => 332
[data] => Array
(
[points] => 100
[cost] => 100
)
)
[1] => Array
(
[id] => 1552
[data] => Array
(
[points] => 100
[cost] => 100
)
)
[2] => Array
(
[id] => 1885
[data] => Array
(
[points] => 294
[cost] => 294
)
)
.
.
Now I loop it again to assign in a variable:
for($x = 0; $x < sizeof($var_data); $x++){
echo "ID: ".$var_data[$x]['id']."<br />";
foreach($var_data as $key => $value){
// it is the part that i don't know how to get the data array values and assign in a varaile.
}
}
Here's what i want to do:
ID: 1
COST: 100.00
TOTAL: 100.00
ID: 2
COST: 65.00
TOTAL: 65.00
ID: 3
COST: 40.00
TOTAL: 40.00
.
.
How can I do that? Is there a simple way?