I have a function that does: return explode("\n",$filestr);
$filestr is the contents of a multiline file (with text on most lines). So theoretically it should return an array, but when I use count() on the value it returns I get 1 no matter what. What am I doing wrong?
Probably something wrong with the assignment where the function is called. The documentation gives one example of how to do it:
http://www.phpbuilder.com/manual/functions.returning-values.php
I would suggest you to use file() instead of opening a file, get it's content and "explode" it at every \n. file() reads a file and puts each line in an array...
$my_file = file("myfile.ext");
first line = $myfile[0]; second line = $myfile[1]; etc.