I have a plain text file with many lines. Each line contains 5 words exactly. Eg:
cat bat rat mat sat
hello hi howdy namaste salaam
here there where nowhere somewhere
a b c d e
......
......
Now I am retrieving the lines one by one using fgets() function. The lines are retrieved perfectly, but when i explode the string to form an array of the 5 words, i see that the trailing line feed character is also included in the array.
So how to remove the trailing line feed character while exploding?
When you get the lines use rtrim