Make everything in brackets bold
$text = "The definition of [recursion] may not be obvious."; 
echo preg_replace ('/\[([^]]+)\]/', '<b>\\1</b>', $text); 

This example produces the following result:

The definition of <b>recursion</b> may not be obvious.

Lowercase all HTML tags in the text
$html_body = "<Blockquote>A <B>rose</B> by any other name..<P></Blockquote>\n"; 
echo preg_replace ('!(</?)(\w+)([^>]*?>)!e',  
			"'\\1'.strtolower('\\2').'\\3'",   
			$html_body); 

This example produces the following output:

<blockquote>A <b>rose</b> by any other name..<p></blockquote> 

In this example, since the /e modifier is present, the captured tag name (\\2 reference) is fed through strtolower() and concatenated with the other captured pieces. Note that the backslashes in the references need to be doubled because of the double quotation marks