[thelist] PHP regexp... Trying to normalise caps

Martin Kuplens-Ewart martin at takingitglobal.org
Thu May 9 12:25:01 CDT 2002


Hey folks...

...i'm grabbing the first char from each <p>...</p> of user-entered
data, and converting it into a drop-caps image... Using preg_replace.

return preg_replace("/<p>(\w)/","<p><img src=\"images/initials/$1.gif\"
width=\"26\" height=\"32\" align=\"absbottom\">",$text);

What I need to do, is make the filename uppercase, so that I actually
get an image - on freebsd, so case-sensitive with no mod_spelling. :(

I tried surrounding the replacement string with strtoupper() but that
had no effect on the captured var....

...any suggestions?



More information about the thelist mailing list