Jump to content

[SOLVED] how do I readline on this string


unomateo

Recommended Posts

This is string:

[code] 0.0 HTML_MESSAGE          BODY: HTML included in message
0.2 AWL                    AWL: From: address is in the auto white-list[/code]

when I look at in html it looks like this:
0.0 HTML_MESSAGE BODY: HTML included in message 0.2 AWL AWL: From: address is in the auto white-list

I need to parse it to get numbers, it would be easy if I could read each line, one at a time.

I've tried looking for '\r\n', and \r and \n seperately, but nothing seems to work...

please help
Link to comment
https://forums.phpfreaks.com/topic/31046-solved-how-do-i-readline-on-this-string/
Share on other sites

if it is all one line, you need to explode on the ' ' and then loop through and find any that are numbers, then insert a break before the numbers, and probable a delimiter after just to make things nicer.

then you can loop by like using file() and explode on your delimiter and have yourself key values...

now this assumes that none of your descriptions use number - if they do maybe you need a number and a decimel point?

just some ideas of where I would start anyway.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.