first, you don't really need to have this line:
$banned_url = array();
just $banned_url[] is fine and will inetilize the array ..
and there is no need to use regexp function here !! it's only string replacement !!
so just use str_replace();
if you want to alert use a small IF statment !!
this will replace all bad URLs (if found) with an Italic "Bad URL" !!
then if the array alert has any elemnts, then we bump it into $error var ..