Quantcast
Viewing all articles
Browse latest Browse all 4

Answer by SilentAssassin for php function file_get_contents and first line of UTF-8 encoded text

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 condition is not getting true.

Also if you can share your test.txt file it will be easy to catch the problem.

EDIT : Partial Solution

You can add this line before first if condition to handle this behaviour as described by @Tino Didriksen to get your desired output.

$array_test[0] = substr_replace($array_test[0],'',0,3);

Viewing all articles
Browse latest Browse all 4

Trending Articles



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