Parse error: parse error, unexpected T_VARIABLE
PHP-Code:
${timeresult$i} = calcDiff($zeit, ${time$i});
${timeresult.$i} = calcDiff($zeit, ${time.$i});
${timeresult.$i} = calcDiff($zeit, ${time.$i});
function calcDiff($zeit, $time) {
$timediff = $zeit - $time;
$y = intval($timediff / 31536000);
$remain = $timediff % 31536000;
$m = intval($remain / 2628000);
$remain = $timediff % 2628000;
$d = intval($remain / 86400);
$remain = $timediff % 86400;
$h = intval($remain / 3600);
$remain = $remain % 3600;
$i = intval($remain / 60);
$s = $remain % 60;
return ($y ? "$y<font color=\"#FF9900\">y</font>" : '')
.($m ? "$m<font color=\"#FF9900\">m</font> " : '')
.($d ? "$d<font color=\"#FF9900\">d</font> " : '')
.($h ? "$h<font color=\"#FF9900\">h</font> " : '')
.($i ? "$i<font color=\"#FF9900\">m</font> " : '')
."$s<font color=\"#FF9900\">s</font>";
}
for ($i = 1; $i <= 10; $i++) {
${'timeresult'.$i} = calcDiff($zeit, ${'time'.$i});
}
Kommentar