View Single Post
Old 12-14-2012, 10:37 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,055
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!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote