View Single Post
  #2 (permalink)  
Old 08-07-03, 12:32 AM
joeldg joeldg is offline
Newbie Coder
 
Join Date: Jul 2003
Location: New Orleans
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
yes there is...

First make an array of your replacements. would most likely be coming from a DB
Then loop through them..
i.e.:
PHP Code:

$repl = array(

    
"[br]" => "<br>",
    
"[hr]" => "<hr>"
); // etc....

function codigo($texto){
global 
$repl;
   while(list(
$key,$val)=each($repl)){
    
$texto str_replace($key,$val,$texto);
   }
//wend

}//end function
#...  etc rest of function 

pretty easy...
cheers
__________________
TAGword, ads the way you always wanted.
<a href="http://tagword.com">tagword.com</a>
Reply With Quote