Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

’ characters are replacing my apostrophes when i'm using php. What should I do to remove this problem?

I tried changing the string to wrap it with a " instead of ' so I can use apostrophes in the string without cancelling it out, but it still happens.

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

A couple of things spring to mind.

Try changing the character set of your document, or try using special character codes to replace certain characters that the browser isn't picking up automatically.

Here's a list of HTML special characters. http://www.degraeve.com/reference/specialcharacters.php

Good luck. :)

Nice response time. I just found out the problem. Originally I've copied and pasted text from my client from a browser application. It seemed to have replaced regular keystroke apostrophe's with some sort of typographic single quote mark or something different. So even when I placed a cancel character, PHP wasn't picking it up. I learned a small, yet perfect lesson.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

One tip for this is to copy the text directly into a text editor and then into the place that you want. This will flush out any strange characters will be flushed out and the text should copy over as needed.