jonas abesamis - 2009-08-11 19:31:23
Hello guys I hope you can help me with this one.
*note: create a blank file named work.html before running my code*
Using rename(),copy() or fwrite() I get an error or weird results.
When Im trying to rename an english file, for example "work.html" to a files with chinese characters, I get a file named "指南.html" instead.
Here is my code:
<?
ini_set('default_charset', 'UTF-8');
$opts = array(
'http'=>array(
//'method'=>"GET",
'header'=>"default_charset = UTF-8"
)
);
$context = stream_context_create($opts);
$xslt_result = "指南";
$work = html_entity_decode($xslt_result, ENT_NOQUOTES,'UTF-8');
print $work.".html should be the resulting file";
rename("work.html", $work.".html",$context);
?>
When I try to use the copy() function I get an error instead. Im using windows vista with XAMPP.
I hope someone can help me with this. I would greatly appreciate it.