Regex (Regular expression) to remove comments from SQL Text.
// Remove the / * * / style comments $subject = preg_replace('%(/\*)(.*?)(\*/)%s',"",$subject); // Remove the — style comments $subject = preg_replace('%(–).*%',"",$subject);