// Escape everything first for full coverage
$text = htmlspecialchars( $text );
// encode all comments or tags as safe blue strings
$text = preg_replace( '/\<(!--.*?--|.*?)\>/', '<span style="color:blue;"><\1></span>', $text );
// identify URLs
// Escape everything first for full coverage
$text = htmlspecialchars( $text );
// encode all comments or tags as safe blue strings
$text = preg_replace( '/\<(!--.*?--|.*?)\>/', '<span style="color:blue;"><\1></span>', $text );
// identify URLs