PDA

View Full Version : PHP: fwite "" into textfile



Danneman
August 7th, 2003, 07:44 AM
Hi!

Im using a simple PHP-script to write to a textfile.

Problem is I want to include the symbol " into the textfile.

Im using the code:


fwrite($FilePointer, "<a href=".$LinkOne.">".$LinkNameOne."</a>" );


And the textfile will display:


<a href=http://www.myLink.com>myLink</a>


What I want in the textfile is the following line (including the ""):


<a href="http://www.myLink.com">myLink</a>


Thanks

Jubba
August 7th, 2003, 09:06 AM
you have to escape the characters using \ so your code would look like this:



fwrite($FilePointer, "\"".$LinkNameOne."\"");

Danneman
August 7th, 2003, 11:21 AM
Sorry about not putting the code in code-area. Its correct now.

Thanks Jubba, that works great :)