Forum Moderators: coopster
PHP has a built in function for this: htmlentities [php.net].
The PHP manual [php.net] is very handy too ;)
[edited by: Receptional_Andy at 4:46 pm (utc) on Oct. 28, 2008]
$newLine = htmlentities($line,ENT_QUOTES);
echo $newLine."<br />\n";
Still not converting the quotation marks. btw, IE is displaying these as small squares or question marks (tried it on two machines).
What worked is this, I copied the "curly quotes" (thanks Andy) from the original document and used them in the str_replace functions below.
$newLine=str_replace('“','"',$line);
$newLine=str_replace('”','"',$line);
Thanks for all your help folks!
[code][/code]$curlyQuotes=array('“','”');
$newLine=str_replace($curlyQuotes,'"',$line);