Log 4400
10/12/2024 2024-12-10 15:37$activities = array(
“תיעוד שעות [זמן1]”,
“תיעוד שעות [זמן2]”,
“תיעוד שעות [זמן3]”
);
$totalTime = 0;
foreach ($activities as $activity) {
if (strpos($activity, “[“) !== false && strpos($activity, “]”) !== false) {
$timeStartPos = strpos($activity, “[“);
$timeEndPos = strpos($activity, “]”);
$timeStr = substr($activity, $timeStartPos + 1, $timeEndPos – $timeStartPos – 1);
if (is_numeric($timeStr)) {
$totalTime += intval($timeStr);
}
}
}
return $totalTime;