$line) { switch (TRUE) { case strpos($line, '#include') : preg_match('/"(.+?)"/', $line, $matches); if ($matches[1]) { $inc = __DIR__ . '/' . $matches[1]; if (file_exists($inc)) $body[$key] = file_get_contents($inc); } break; // Wednesday, 24-Apr-2024 23:27:46 UTC case strpos($line, 'DATE_LOCAL') : $date = date('l, d-M-Y H:i:s T'); $line = str_replace('Wednesday, 24-Apr-2024 23:27:46 UTC', $date, $line); $body[$key] = $line; break; default : // do nothing } } $html = implode("\n", $body); echo $html;