Jump to content

Save Iso 8859-1 Characters To Textfile


ameisez

Recommended Posts

I got this code to edit/save a specific text file online.

<?phpif($_POST['Submit']){$open = fopen("b1.txt","w+");$text = $_POST['update'];fwrite($open, $text);fclose($open);echo "File updated.<br />";echo "File:<br />";$file = file("b1.txt");foreach($file as $text) {echo $text."<br />";}}else{$file = file("b1.txt");echo "<form action=\"".$PHP_SELF."\" method=\"post\">";echo "<textarea Name=\"update\" cols=\"50\" rows=\"10\">";foreach($file as $text) {echo $text;}echo "</textarea>";echo "<input name=\"Submit\" type=\"submit\" value=\"Update\" />\n</form>";}?>

This works fine except when I input special character from ISO 8859-1 Characters. How can i make it save all special characters in "Entity Number Format" so that when it is read back it will show the special character? For example, when I enter Hello Günter it should be saved as

Hello Günter

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...