View Single Post
  #6 (permalink)  
Old 08-08-03, 01:40 AM
nd2 nd2 is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
$thearr = array(
"\[br](.*?)\[/br]" => "<br>\\1</br>",
"\(.*?)\" => "<u>\\1</u>" );

foreach (array_keys($thearr) as $i) {
$input = preg_replace( "#$i#si", $thearr[$i], $input );
}

// i havent tested it, but it whould cut your replaces by 1/2, but you will need to use the preg_replace function which is slower, maybe try timing them to see which is faster?
__________________
IonCMS (Coming Soon.)
http://ioncms.com
--
Ncaster (Free php/mysql cms)
http://ncaster.cjb.net
Reply With Quote