Kód: Vybrať všetko
function saveFile($destination,$content) {
if (ini_get('magic_quotes_gpc')) {
$content = stripslashes($content);
}
$open = fopen($destination,"w+");
if ($open) {
if (flock($open,LOCK_EX)) {
fwrite ($open, $content);
flock ($open, LOCK_UN);
}
fclose($open);
@chmod($destination,0777);
} else {
die("Unable to save file (the file may not be writeable, or may not have been created yet. Check the directory permissions.");
}
return (true);
}Mozete mi prosim poradit ako nastavit server alebo aspon upravit kod tak, aby subory ukladal v UTF-8 ?
Dakujem!
//EDIT :
Skusal som aj fwrite($fh,utf8_encode($myString)); ako to je na php.net ale akosi bez uspechu