Jump to content

Save Iso 8859-1 Characters To Textfile


ameisez
 Share

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

Edited by green_apple
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...