dbradbury Posted February 17, 2010 Share Posted February 17, 2010 i know its done my explode but what represented as a line break, /n, /r or both /n/r? and how would i retrieve the info i need...? $data = explode("/n/r", $info) $data[0] like that? Link to comment https://forums.phpfreaks.com/topic/192450-split-data-into-lines/ Share on other sites More sharing options...
sader Posted February 18, 2010 Share Posted February 18, 2010 \n or \n\r represents line break(end of line) and it depends of OS. You can try use PHP_EOL I think it then will be OS independent code $lines = explode(PHP_EOL, $text); for($i=0; $i<count($lines); $i++) { echo $lines[$i]."<br />"; } Link to comment https://forums.phpfreaks.com/topic/192450-split-data-into-lines/#findComment-1014065 Share on other sites More sharing options...
dbradbury Posted February 18, 2010 Author Share Posted February 18, 2010 thanks PHP_EOL worked perfectly! Link to comment https://forums.phpfreaks.com/topic/192450-split-data-into-lines/#findComment-1014068 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.