Hi everyone,

I'm new to PHP and I am trying to get to grips with the PHP scripts that have been created for my website.

One of my pages is a list of destinations and one of the places is Cote d'Azur.

When it publishes the destination on the dynamic page it comes out as Cote d\'Azur.

Why does it does this and is there a solution to resolve this issue that I can make within the PHP file.

Many thanks

I have encountered this before and you might wanna research on "Magic Quotes" in the php manual. I don't know exactly what to tell you to do, but if you could give an example of your code that outputs the string it would be much better.

Hi everyone,

I'm new to PHP and I am trying to get to grips with the PHP scripts that have been created for my website.

One of my pages is a list of destinations and one of the places is Cote d'Azur.

When it publishes the destination on the dynamic page it comes out as Cote d\'Azur.

Why does it does this and is there a solution to resolve this issue that I can make within the PHP file.

Many thanks

Read carefully the PHP manual. Special characters like quotes and slashes are reserved characters in PHP. If you want to have a special char inside a text, stored in a variable, you should add a slash before the special character. Thus PHP understands that this is a special char.

E.G.

you want to store this - Cote d'Azur in a variable. You have 2 ways to do that :
1. add a slash manually when loading the string into the variable
or
2. use the function addslashes('your string here');

in both cases, when you retrieve your variable, you will have a slash in front of the '

If you want to get rid of it, you should use stripslashes('string where there is a slash before apostrophe goes here');

For more information read here:

http://bg2.php.net/manual/en/function.stripslashes.php

Good Luck

Thank you everyone who has helped me!!

I've sorted this problem and used

<? echo stripslashes($field);?>
This article has been dead for over six months. Start a new discussion instead.