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 ArticleAnswer 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 ArticleAnswer 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 Articlephp 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
More Pages to Explore .....