I've got a CMS to fix some issues. Since the hosting service has enabled php_magic_quotes in the server their database contains content with slashes. Once I got the project I requested the hosting party to switch off the magic_quotes and the issues isn't available anymore. However I need to fix existing affected data because of magic quotes. Is there any mysql or php command where I can use to fix these. Some records badly affected. As an example I can see something like this in the database you\\\\\\'r
Appreciate any suggestion to fix these existing data.
Asked
Active
Viewed 139 times
2

Prasad Rajapaksha
- 6,118
- 10
- 36
- 52
1 Answers
3
Just use stripslashes
to unescape your data:
var_dump(stripslashes("you\\\\\\'r")); // string(6) "you\'r"

Alix Axel
- 151,645
- 95
- 393
- 500
-
Great... Thanks. I never thought this will help. I will try this by writing a script and will update you. Thank you for the answer. – Prasad Rajapaksha Aug 16 '12 at 06:30