0

I have message stored in my database containing a slash: e.g. don\'t

To present the message I use this procedure. The thing is the backslash is still displayed. How can I get rid of it. I have tried many things, and read several postings here, but can't get it to work. Anyone here to help me and tell me what is the best way..

            $msg2 = html_entity_decode($row3[comment]);
            echo stripslashes(nl2br($msg2));
thebluephantom
  • 16,458
  • 8
  • 40
  • 83
Mark Henry
  • 2,649
  • 7
  • 40
  • 48

1 Answers1

1

When storing them in the database, you should store them as mysql_real_escape_string($phpString).

Why do you use html_entity_decode for this? Just stripslashes should be sufficient here..

Richard
  • 4,341
  • 5
  • 35
  • 55