Let's say I want to know the encoding of a text file, does PHP file_get_contents automatically turn contents into ASCII?
<pre>
<?php
$file = file_get_contents('./test.txt', true);
echo $file."<br>".mb_detect_encoding($file);
echo "<br>";
$file = file_get_contents('./test (2).txt', true);
echo $file."<br>".mb_detect_encoding($file);
echo "<br>";
$file = file_get_contents('./test (3).txt', true);
echo $file."<br>".mb_detect_encoding($file);
?>
It does not convert the contents to ASCII. Because it is only getting the contents of a file it has no need to. More information is at http://us3.php.net/manual/en/function.file-get-contents.php