Dynamische Daten in Seitentemplates eingefügt

This commit is contained in:
Matthias Grief
2024-10-28 18:57:59 +01:00
parent 7d162dfadf
commit 26266096ee
18 changed files with 1653 additions and 499 deletions

18
webseite/classes/Util.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
class Util
{
static function removeIllegalCharacters($string): string
{
return preg_replace("/[^a-zA-Z0-9_-]/", "", $string);
}
static function parseJsonFromFile($filename): mixed
{
$file = fopen($filename, "r") or die("Unable to open file!");
$fileContent = fread($file, filesize($filename));
fclose($file);
return json_decode($fileContent);
}
}