我的目标:创建动态变量,例如
$counterMon00 = 0;
$counterMon01 = 0;
$counterThu23 = 0;
到目前为止我的代码:
$array_days = ["Mon","Tue","Wed","Thu","Fri"];
for ($i = 0; $i < sizeof($array_days); $i++)
{
$weekDay = (String) $array_days[$i];
for($ii = 7; $ii < 10; $ii++)
{
"counter".${$weekDay}.${$ii} = 0;
}
}
你能帮我解决这个问题吗
"counter".${$weekDay}.${$ii} = 0;
我尝试了不同的解决方案,但没有任何效果......