[SOLVED]' changes to \'

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
Cypher87
Forum Newbie
Posts: 5
Joined: Mon Jun 07, 2004 3:20 pm

[SOLVED]' changes to \'

Post by Cypher87 »

Hi, I made a scripts which gets text from a textarea (html), but somehow it changes ' into '' is there anyway how I can change this or is str_replace good enough?

This is my code:

Code: Select all

$file = $_POSTї"filename"];
$content = $_POSTї"text"];
$file = fopen($file,"w");
fwrite($file,str_replace("''","'",$content));
fclose($file);
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

check out stripslashes().
Cypher87
Forum Newbie
Posts: 5
Joined: Mon Jun 07, 2004 3:20 pm

Post by Cypher87 »

Thank you :wink:
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

no problem mate ;)
Post Reply