Fewo/ PDFs / Mails v3
This commit is contained in:
parent
7abfe3f700
commit
e537e47a82
44 changed files with 2112 additions and 527 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue