just a suggestion, but to decrease the size of the script, consider sticking the search and replacements into arrays. also, just using str_replace (or as Hawkee suggested, str_ireplace), means that you aren\'t actually validating the input, meaning that the user could possibly break up the format of the output page by adding too many closing or opening tags. A preg_replace would be better, that way if there are any mismatches, they aren\'t replaced at all.