Re: [Phplib-users] $75 Million - 75 Million Dollars NOT {blank} million
Brought to you by:
nhruby,
richardarcher
From: James W. <jwi...@ma...> - 2001-10-30 22:27:00
|
At 4:19 PM -0500 10/30/01, nathan r. hruby wrote: >Go thee to the php-lib-stable CVS: extract the template.inc from thither >and rejoyce! I'm still experiencing the trouble mentioned here with version 1.8 of template.inc from CVS. I have resorted to manually placing $ in my templates for the time being, but unfortunately Dreamweaver seems to like to rewrite it as $ if a designer resaves the file. Some preg_replace love would be much appreciated. Code in question (starting line 164): function set_var($varname, $value = "") { if (!is_array($varname)) { if (!empty($varname)) { if ($this->debug) print "scalar: set *$varname* to *$value*<br>\n"; $value = preg_replace(array('/\$([0-9])/', '/\\\\([0-9])/'), array('$\1', '\\1'), $value); $this->varkeys[$varname] = "/".$this->varname($varname)."/"; $this->varvals[$varname] = $value; } } else { reset($varname); while(list($k, $v) = each($varname)) { if (!empty($k)) { if ($this->debug) print "array: set *$k* to *$v*<br>\n"; $v = preg_replace(array('/\$([0-9])/', '/\\\\([0-9])/'), array('$\1', '\\1'), $v); $this->varkeys[$k] = "/".$this->varname($k)."/"; $this->varvals[$k] = $v; } } } } Looks like it should work to me... |