summaryrefslogtreecommitdiffstats
path: root/code/subst.inc.php
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-01-06 14:10:03 +0100
committerneoraider <devnull@localhost>2006-01-06 14:10:03 +0100
commita89ac4fda6c7cab6cace4078491c29f215213ab2 (patch)
tree9f53ea434c2ffe1cb625aec798ff13f873731e7d /code/subst.inc.php
downloadneon-a89ac4fda6c7cab6cace4078491c29f215213ab2.tar
neon-a89ac4fda6c7cab6cace4078491c29f215213ab2.zip
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);
+ }
+ }
+?>