# PHP file adding extra characters to txt file

**URL:** <https://forum.kirupa.com/t/php-file-adding-extra-characters-to-txt-file/24995>\
**Category:** programming\
**Created:** [July 8, 2003, 5:30am UTC](https://forum.kirupa.com/t/php-file-adding-extra-characters-to-txt-file/24995 "2003-07-08T05:30:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meridian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/meridian/32/243_2.png) [@Meridian](https://forum.kirupa.com/u/Meridian)\
**Post date:** [July 8, 2003, 5:30am UTC](https://forum.kirupa.com/t/php-file-adding-extra-characters-to-txt-file/24995/1 "2003-07-08T05:30:46Z")

</div>

Hi there I’m a total noob to php and I’m trying to use it to write datat to a text file so flash can read it back in as news from a text file.

I got the php working and writing to the text file but… every where I use " or ’  
it adds a \ before it

EXAMPLE  
\<font color="#0058C9" size=“10”\>\<b\>May '03\</b\>\</font\>

Anyone know how to fix this?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 5:32pm UTC](https://forum.kirupa.com/t/php-file-adding-extra-characters-to-txt-file/24995/2 "2003-07-08T17:32:34Z")

</div>

hmm… from where are you sending the text to the php file to write to write to the text file?

cause “” character is an escape character… it tells flash or php that the following quote is part of the text and not something to close the text open and close quotes…

ex: PHP will read the following

“Too “many” quotes”

as

“Too” and then probably an error

but if u do this…

“Too “many” quotes”

it will read it right (as Too “many” quotes)

-Aditya  
:thumb:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 5:39pm UTC](https://forum.kirupa.com/t/php-file-adding-extra-characters-to-txt-file/24995/3 "2003-07-08T17:39:41Z")

</div>

Actually, I fixed it I used

stripslashes()

but now my the info that is being written to my php file is showing up all garbled when I open the text file to make sure what I wrote to the file is correct…

Thanks for your help 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 8:29pm UTC](https://forum.kirupa.com/t/php-file-adding-extra-characters-to-txt-file/24995/4 "2003-07-08T20:29:28Z")

</div>

urlencode
