summaryrefslogtreecommitdiffstats
path: root/code/subst.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'code/subst.inc.php')
-rw-r--r--code/subst.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/code/subst.inc.php b/code/subst.inc.php
new file mode 100644
index 0000000..72935a2
--- /dev/null
+++ b/code/subst.inc.php
@@ -0,0 +1,17 @@
+<?PHP
+ if(!defined('SUBST_INC')) {
+ define('SUBST_INC', 1);
+
+ function Subst($string, $subst = array()) {
+ $tr['$$'] = '$';
+
+ while(current($subst)) {
+ $tr['$' . key($subst)] = $subst[key($subst)];
+
+ next($subst);
+ }
+
+ return strtr($string, $tr);
+ }
+ }
+?>