Pound Signs Problem Solved

22nd August 2002 · Last updated: 5th October 2016
 

Sorted out my problem with pound signs not showing in Mozilla, by filtering the text first with PHP. If your text is in various strings, you can add this code, then just repeat the second line, where $string is the name of the string:

$trans = array("£" => "£");
$string = strtr($string, $trans);

If you're just outputting the contents of a file, you can use this code instead to filter it all:

$fp2 = fopen($filename, "rb");

if (!$fp2) {echo "Unable to open remote file."; exit;}

$trans = array("£" => "£");
$contents = fread ($fp2, filesize ($filename));
$contents = strtr($contents, $trans);
 
print $contents;

Replace $filename with the physical name of the file you're opening. Now Mozilla will display the pound signs on your page. (Discuss...)