Im trying to change the encoding of a php file (through another php page) to UTF-8 , i mean without editor .
i tried to use file_get_contents and file_put_contents .
i used this code but it doesn't work !
$text = file_get_contents('testencoding.php');
$text = mb_convert_encoding($text, "UTF-8");
file_put_contents('testencoding.php',$text);
this code above is working only if there is a "arabic" characters in the page.
Thanks,
doesn't work. And why don't you specify thefrom_encodingif you know it?from_encodingbecause im making a website to convert the encoding from any encoding to UTF-8, i tried to usemb_detect_encodingbut it returnsbool(false).. Thanks.