I know how to read line by line from a file, but how do I do this from a variable?
I read a textfile into $buffer.
Then I replace '\n' with '<br>' tags and store the contents in a variable called $content.
Hmm.. I can see a problem arising. I have removed the \n tags, so it will all be one long string now.........
So I will not be able to read line by line from a variable.
What I am trying to accomplish is:
mytext.txt might look like
21.05.2003
some text
some more text
01.06.2003
just one line of text
EOF
1) Read line by line
2) Check to see if the line is in date format.
3) If date format , output the text within <td> tags.
4) Read rest of line until next date format, and output text within <td> tags.
5) Until EOF.
Is there a simple way of doing this?
The text between the dates, must replace the '\n' with '<br>'.
Cheers!