I can't figure this out...
How do I display a value from the first part of an array like this:
$payments['plan'][] = array(
'hours' => '2 Hours',
'price_a' => '90.00',
'price_b' => '190.00',
);
$payments['plan'][] = array(
'hours' => '3 Hours',
'price_a' => '110.00',
'price_b' => '220.00',
);
$payments['plan'][] = array(
'hours' => '4 Hours',
'price_a' => '120.00',
'price_b' => '350.00',
);
In the above, let's say I wanted to display -- "90.00" -- how would I get that from the array?
I've tried different variations of reset, done some searching, can't figure this out... just how to display that value from the first part of the array.
Any suggestions?
Doing this:
reset($payments);
echo key($payments['plan']);
I just get the result: "0"
echo $payments['plan'][0]['price_a'];- Take note of example #4