unomateo Posted December 18, 2006 Share Posted December 18, 2006 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-listI 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 More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 Post some code. Or at least tell us what your trying to parse out of this string and where the string is comming from. Link to comment https://forums.phpfreaks.com/topic/31046-solved-how-do-i-readline-on-this-string/#findComment-143338 Share on other sites More sharing options...
drifter Posted December 18, 2006 Share Posted December 18, 2006 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. Link to comment https://forums.phpfreaks.com/topic/31046-solved-how-do-i-readline-on-this-string/#findComment-143341 Share on other sites More sharing options...
unomateo Posted December 21, 2006 Author Share Posted December 21, 2006 I ended up using nl2br() and then exploded using the br tags...for some reason I could read the newlines until I ran that function. Link to comment https://forums.phpfreaks.com/topic/31046-solved-how-do-i-readline-on-this-string/#findComment-145986 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.