<?php
$url_1="http://www.example.com/sample/index.php";
$anchor_1="Jim's text";
if (get_magic_quotes_gpc()) {
$anchor_1 = stripslashes( $anchor_1 );
}
$myFile = "../siteinc/news.html";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = '<a href=\"'.$url_1.'\">'.$anchor_1.'</a>';
fwrite($fh, $stringData);
fclose($fh);
?>
reusults in this html
<a href="%5C%22http://www.example.com/sample/index.php%5C%22">Jim's text</a>
In practice, $url_1 is a variable that has been posted to the php file.
[php5 in use - though I don't think that affects things here]
How can I get rid of the two lots of %5C%22 that have been inserted into the hyperlink in the final file?