addslashes(string) // alternatively $this->$field=str_replace("\"","\\\"",$this->$field);