0

Some of my strings that I echo out from my database has seven \u7 (%07) attached to it, I have never seen that before, does anyone know what it is and how to remove it from the string?

enter image description here

I have tried:

  $pat = array("\r\n", "\n\r", "\n", "\r", "\u7");
  $val = str_replace($pat, '', $val);

and different php Sanitize filters but nothing seems to remove it

Linda
  • 45
  • 4
  • This screams character encoding issue. What is the collation of your table? And does your site use UTF8? – Machavity Feb 08 '17 at 13:56
  • @Machavity the collation is latin1_swedish_ci and the site utf8 – Linda Feb 08 '17 at 13:59
  • @Linda That would explain it. You need to convert your tables to use UTF8. While stripping the characters would fix this one problem, you're going to have a whole host of problems if you don't have them work together. In other words, you're going to have to either do that or deal with bad encoding coming and going from the DB – Machavity Feb 08 '17 at 14:01

0 Answers0