Skal gemme teksten som UTF-8
Jeg har brug for at dette PHP-script gemmer teksten som UTF-8, men ved ikke hvordan .....Kan nogen hjælpe??
<?
$Website = eregi_replace("http://", "", $Website);
$Name = stripslashes($Name);
$Country = stripslashes($Country);
$Email = stripslashes($Email);
$Website = stripslashes($Website);
$Comments = stripslashes($Comments);
if ($Submit == "Yes") {
$filename = "GuestBog_37.txt";
$fp = fopen( $filename,"r");
$OldData = fread($fp, 80000);
fclose( $fp );
$Today = (date ("l dS of F Y ( h:i:s A )",time()));
$Input = "Name: <b>$Name</b><br>Country: <b>$Country</b><br>Email: <b><u><a href=\"mailto:$Email\">$Email</a></b></u><br>Website: <b><u><a href=\"http://$Website\" target=\"_blank\">$Website</a></b></u><br>Comments: <b>$Comments</b><br>Date: $Today<br><br>**************************************<br><br>.:::.";
$New = "$Input$OldData";
$fp = fopen( $filename,"w+");
fwrite($fp, $New, 80000);
fclose( $fp );
}
$filename = "GuestBook.txt";
$fp = fopen( $filename,"r");
$Data = fread($fp, 80000);
fclose( $fp );
$DataArray = split (".:::.", $Data);
$NumEntries = count($DataArray) - 1;
print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";
for ($n = $NumLow; $n < $NumHigh; $n++) {
print $DataArray[$n];
if (!$DataArray[$n]) {
Print "<br><b>No More entries</b>";
exit;
}
}
?>