ciber Posted September 25, 2010 Share Posted September 25, 2010 I have tried to look google, but was unable to find anything. and the search daemon is giving me errors on this site. So, when I am calling lines from a text file, I am getting a problem. to explain, I will use a # to show were this "white space" is I am getting This is the text file url.com url2.com url3.com when PHP reads the file, and I output it into PHP its reading it like this url1.com# url2.com# url3.com url1.com and url2.com both are getting this "white space" at the end of them, and the last entry does not. I have tried to use str_replace(" ","",$line) and str_replace("\r","",$line) but nothing. can anyone advise me as to what character this is that is being outputed. my code I'm using $f = fopen ("list.txt", "r"); while ($line= fgets ($f)) { if($url == $line){echo $line;} } fclose ($f); Link to comment https://forums.phpfreaks.com/topic/214342-fget-has-white-space/ Share on other sites More sharing options...
Chris92 Posted September 25, 2010 Share Posted September 25, 2010 \n Link to comment https://forums.phpfreaks.com/topic/214342-fget-has-white-space/#findComment-1115428 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.