techjosh
05-21-2009, 02:26 PM
Hello. I'm finding this surprisingly confusing, and more surprising at how no one else seems to be confused by it.
In PHP I need to detect a line for a blank space using fgets(). I've tried using the following "\n" '\n' "\r\n" 'null' ' ' " " etc. and nothing seems to work
The following function is suppose to read a text file and set $cap to the paragraph in the text file until a blank line is read in the text file (the entire thing is in another loop to do it again for another paragraph until end of file)
do{
$temp = fgets($file);
if($temp != "\n")
$cap = $cap . $temp . "<br/>";
}while($temp != "\n");
In PHP I need to detect a line for a blank space using fgets(). I've tried using the following "\n" '\n' "\r\n" 'null' ' ' " " etc. and nothing seems to work
The following function is suppose to read a text file and set $cap to the paragraph in the text file until a blank line is read in the text file (the entire thing is in another loop to do it again for another paragraph until end of file)
do{
$temp = fgets($file);
if($temp != "\n")
$cap = $cap . $temp . "<br/>";
}while($temp != "\n");