PHP file_get_contents () automatically convert content to ASCII?

Let's say I want to know the encoding of a text file, does PHP file_get_contents automatically convert the content to 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);


?>

      

+3


source to share


1 answer


It does not convert content to ASCII. Because it only gets the contents of the file, which is not needed. More information is at http://us3.php.net/manual/en/function.file-get-contents.php



0


source







All Articles