$profile_text = preg_replace('/\'\'/', '\'', $profile_text); if ($_POST["text"] != ""){ $new_profile_text = mysql_real_escape_string($_POST["text"]);