• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

php str_replace

I am storing special characters like " and ' in my database as " and '.

Subsequently, I am using a package called fpdf to create a pdf; of course I want the special characters to appear as " and ' in the pdf.

I am using this: $r = str_replace(""", chr(34), $x);

It doesn't work.

Richard Korts
Richard Korts
1 Solution
That should work fine, are you sure the data is stored that way?
Post a sample output from the db here.
Richard KortsAuthor Commented:
To GaryC123,

It DID work, I just realized, based on your comment that in the database I don't have the trailing ; after the html code.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now