1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 00:06:14 +01:00
openstamanager/templates/replace.php

19 lines
587 B
PHP
Raw Normal View History

2017-09-08 18:19:39 +02:00
<?php
/**
* Sostituisce a delle stringhe ($nome_stringa$) i valori delle anagrafiche.
*/
$replaces = array_merge($replaces, (array) $custom);
foreach ($replaces as $key => $value) {
2019-07-11 17:20:58 +02:00
$new_key = '$'.str_replace('$', '', $key).'$';
2017-09-08 18:19:39 +02:00
unset($replaces[$key]);
2019-07-11 15:05:36 +02:00
$replaces[$new_key] = $value;
2017-09-08 18:19:39 +02:00
}
// Sostituisce alle variabili del template i valori
$head = str_replace(array_keys($replaces), array_values($replaces), $head);
$foot = str_replace(array_keys($replaces), array_values($replaces), $foot);
$report = str_replace(array_keys($replaces), array_values($replaces), $report);