AV1611 Posted December 29, 2006 Share Posted December 29, 2006 I can't seem to get rid of the return at in the last cell of this text... what I did with str_replace didn't fix it... how do I get rid of the EOL/LF whatever in the last cell??? [code]foreach ($lines as $line_num => $line) { if($line_num > 1){ $data=explode(" ",$line); $aa=$data[0]." ".$data[1]; $bb=$data[2]; $cc=$data[3]; $dd=$data[5]; $ee=$data[6]; $ee=str_replace("\n","",$ee);[/code] Link to comment https://forums.phpfreaks.com/topic/32136-solved-parsing-out-text-file/ Share on other sites More sharing options...
corbin Posted December 29, 2006 Share Posted December 29, 2006 keep $ee=str_replace("\n","",$ee);and also add $ee=str_replace("\r","",$ee);and then see if it works Link to comment https://forums.phpfreaks.com/topic/32136-solved-parsing-out-text-file/#findComment-149132 Share on other sites More sharing options...
trq Posted December 29, 2006 Share Posted December 29, 2006 Use [url=http://php.net/trim]trim[/url]. Link to comment https://forums.phpfreaks.com/topic/32136-solved-parsing-out-text-file/#findComment-149133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.