Quantcast
Channel: php function file_get_contents and first line of UTF-8 encoded text - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by SilentAssassin for php function file_get_contents and first line of...

The main issue is this but I am not able to solve it yet. On var_dump($array_test[0]) I get the following output:string '1' (length=4)This is the reason 'first line' is not echoed as the if...

View Article



Answer by kwelsan for php function file_get_contents and first line of UTF-8...

Please try below updated code: $array_test = array();$file = file_get_contents ('./test.txt');$file_array = explode("\n", $file);foreach ($file_array as $line) { $word = trim($line); $array_test[] =...

View Article

Answer by Soul_man for php function file_get_contents and first line of UTF-8...

(Try doing) -- wrong solution. see belowif($array_test[0] === "1") echo "first line";and there is one function file() for such cases:$file = file_get_contents ('./test.txt');$file_array = explode("\n",...

View Article

php function file_get_contents and first line of UTF-8 encoded text

I have the following code:$array_test = array();$file = file_get_contents ('./test.txt');$file_array = explode("\n", $file);foreach ($file_array as $line) { $word = trim($line); $array_test[] =...

View Article
Browsing latest articles
Browse All 4 View Live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>