Looking at it, I don't like the strip_newlines function in there either...lol.
I always use chr(13) and chr(10) for my new line indicators and it never fails.
So, on the read (the fget) you can do a replace of all of it and get rid of the function.
changing the read to:
array_push($words, str_replace(chr(13),'',str_replace(chr(10), '', fgets($handle))));
and getting rid of the function should take care of it nicely. If you also want rid of spaces and such (just in case) then:
array_push($words, trim(str_replace(chr(13),'',str_replace(chr(10), '', fgets($handle)))));
Should take care of it.
__________________
All cookies cleared!
|