Newbie Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
starsol
Forum Newbie
Posts: 24
Joined: Thu Jul 31, 2003 8:30 am
Location: Norfolk, England.
Contact:

Newbie Question

Post by starsol »

When using fopen to create a file, PHP automatically escapes any quotation marks. How can I get around this? I've looked up stripslashes in the PHP manual but at the moment it's way over my head.

Thanks in advance for any help :D

Rupe
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

it escapes them for a reason. are you sure you want to strip the slashes?

$a=stripslashes($a);
will remove all slashes from $a

umm....

assuming

$a="who's the one who said \"i love you\" first?\nshe's the one.";

then

$a=stripslashes($a);

changes a from

who's the one who said \"i love you\" first?\nshe's the one.

to

who's the one who said "i love you" first?\nshe's the one.
starsol
Forum Newbie
Posts: 24
Joined: Thu Jul 31, 2003 8:30 am
Location: Norfolk, England.
Contact:

Post by starsol »

Thanks :)

The reason I wanted to get rid of them is because the script is writing HTML files based on input from visitors to the website, and the vast majority will include quotation marks at some point.
Post Reply