Tuesday, 15 May 2012

text - Does PHP file_get_contents() automatically turn contents into ASCII? -



text - Does PHP file_get_contents() automatically turn contents into ASCII? -

let's want know encoding of text file, php file_get_contents automatically turn contents 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 not convert contents ascii. because getting contents of file has no need to. more info @ http://us3.php.net/manual/en/function.file-get-contents.php

php text file-get-contents

No comments:

Post a Comment