我在php中有一个多维数组
看起来像这样:
Array
(
[0] => Array
(
[day] => 0
[periods] => Array
(
[0] => Array
(
[0] => 01:00
[1] => 01:30
)
[1] => Array
(
[0] => 02:30
[1] => 03:00
)
)
)
[1] => Array
(
[day] => 1
[periods] => Array
(
[0] => Array
(
[0] => 01:30
[1] => 02:00
)
)
)
那天“0”=“星期一”的“日”密钥
并且“句点”键会影响用户在同一天选择的小时.
所以在白天[0]中有一个’周期’数组,对于存储小时的anthor数组,开始01:00,结束01:30开始02:30,结束03:00
我尝试foreach循环这个数组但我找不到方法.
我想每小时输入这个值到mysql,如下所示:
$sql = "INSERT INTO task_list (
task, day, hour
) VALUES (?, ?, ?)
";
例如:日:0开始1:00,日:0结束1:30
有什么建议?
|