PHP: fwite "" into textfile

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

you have to escape the characters using \ so your code would look like this:


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

Sorry about not putting the code in code-area. Its correct now.

Thanks Jubba, that works great :slight_smile: