diff options
author | neoraider <devnull@localhost> | 2006-01-06 14:10:03 +0100 |
---|---|---|
committer | neoraider <devnull@localhost> | 2006-01-06 14:10:03 +0100 |
commit | a89ac4fda6c7cab6cace4078491c29f215213ab2 (patch) | |
tree | 9f53ea434c2ffe1cb625aec798ff13f873731e7d /code/subst.inc.php | |
download | neon-a89ac4fda6c7cab6cace4078491c29f215213ab2.tar neon-a89ac4fda6c7cab6cace4078491c29f215213ab2.zip |
Diffstat (limited to 'code/subst.inc.php')
-rw-r--r-- | code/subst.inc.php | 17 |
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); + } + } +?> |