Lo que necesito es forzar a que el archivo txt generado sea codificado rtf-8 para que me lo lea Flash.
Cualquier ayuda se agradecerá. ;)
Dejo el código:
Código PHP:
<?php
$saving = $_REQUEST['saving'];
if ($saving == 1) {
$data = $_POST['data'];
$file = "data.txt";
$fp = fopen($file, "w") or die("Couldn't open $file for writing!");
fwrite($fp, $data) or die("Couldn't write values to file!");
fclose($fp);
echo "Saved to $file successfully!";
}
?>
<meta http-equiv="Content-type" value="text/html; charset=UTF-8" />
<form name="form1" method="post" action="form.php?saving=1">
<textarea name="data" cols="100" rows="10">
<?php
$file = "data.txt";
if (!empty($file)) {
$file = file_get_contents("$file");
echo stripslashes($file);
}
?>
</textarea>
<br>
<input type="submit" value="Save">
</form>