Fewo/ PDFs / Mails v3

This commit is contained in:
Kevin Adametz 2019-05-06 20:21:40 +02:00
parent 7abfe3f700
commit e537e47a82
44 changed files with 2112 additions and 527 deletions

View file

@ -52,4 +52,19 @@ class Util
strtolower($clean) :
$clean;
}
public static function replacePlaceholders($search, $replace){
preg_match_all("/\{{(.+?)\}}/", $search, $matches);
if (isset($matches[1]) && count($matches[1]) > 0){
foreach ($matches[1] as $key => $value) {
$kvalue = trim($value);
if (array_key_exists($kvalue, $replace)){
$search = preg_replace("/\{\{$value\}\}/", $replace[$kvalue], $search);
}
}
}
return $search;
}
}