$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
$text = $q2s;
if(preg_match($reg_exUrl, $text, $url)) {
$text = preg_replace($reg_exUrl, '', $text);
//$text = substr($text, 0, 200);
echo $text;
} else {
echo $text;
}