Reading the official manual, if I want to skip empty line in a txt file, I just need to call the function file() with FILE_SKIP_EMPTY_LINES. I wrote:
$fileArray = file($uploadDirectory . $tracklistFile_name, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
but it also shows empty lines. So, in a text like this :
// START OF THE DOCUMENT
aaa
bbb
ccc
ddd
// END OF THE DOCUMENT
In fact sizeof($fileArray) is 6 : it adds the empty lines between bbb and ccc, and the last one. Why?
There are a load of ways you could clean up the array but I like this one: