First up, the excessive slashes. This is generally caused by over escaping which can be due to magic_quotes
, it is suggested to turn it off and use mysql_real_escape_string
on the data going into the database. Before you turn it off though, make sure that the data is escaped properly, as this could introduce sql injections exploits in your site.
As far as the weird character. Your database and website character sets need to match. Make sure your website charset is set to utf-8, either with a meta tag or a header
setting.
Its a hard change for the magic_quotes
, but once it is done, you do not have to worry about using stripslashes
on your data again. As you should not have to stripslashes
on data coming out of the database, if it was escaped properly in the first place.