+1  A: 

First use preg_match to extract the contents of the [code][/code] tags, and highlight_code() that.

Use the results to preg_replace() the code area in the original string with the highlighted code. Pseudocode-ish:

$code = preg_match(/code pattern/, $string);
$code = highlight_code($code);
$string = preg_replace(/code pattern/, $code, $string);

Hope it works.

Jonah Bron
Thank you so much Jonah! Great answer, thank you!
Jack Webb-Heller