Jump to content

[SOLVED] Capital Letters error


env3rt

Recommended Posts

preg_replace() compares a pattern to a string and replaces that pattern with the provided replacement string. so you'll need to loop over the dis-allowed tags and use preg_replace, or build a crafty regular expression that does it in one shot. we'll stick to the easy version:

 

$bad_tags = array("<BR>","<UL>","<WHATEVER>");
foreach ($bad_tags AS $a_bad_tag) {
     $pattern = "/^$a_bad_tag$/i"; // or something similar, i'm not regex pro...
     preg_replace($pattern, "<nocode>", $string); // Where $string is the content
}
echo $string; // replaced string.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.