This is my php code
echo '<pre>';
print_r($weekdays); echo '<br/>';
foreach ($weekdays as $key => $day) {
print_r($day); echo '<br/>';
echo 'key - '. $key; echo '<br/>';
echo 'val - '. $day['val']; die;
}
This is result of this
Array
(
[sunday] => Array
(
['val'] => 1
['from'] => 6:00:00
['to'] => 6:00:00
)
[monday] => Array
(
['val'] => 1
['from'] => 6:00:00
['to'] => 6:00:00
)
[tuesday] => Array
(
['from'] => 7:00:00
['to'] => 0:00:00
)
[wednesday] => Array
(
['from'] => 0:00:00
['to'] => 0:00:00
)
[thuesday] => Array
(
['from'] => 0:00:00
['to'] => 0:00:00
)
[friday] => Array
(
['from'] => 0:00:00
['to'] => 0:00:00
)
[saturday] => Array
(
['from'] => 0:00:00
['to'] => 0:00:00
)
)
Array
(
['val'] => 1
['from'] => 6:00:00
['to'] => 6:00:00
)
key - sunday
val -
the problem is in my foreach i try to get $day['val'] but nothing shown . tried by using $day->val also . when i print_r($day) i get
Array
(
['val'] => 1
['from'] => 6:00:00
['to'] => 6:00:00
)
Please help me.