Why would echoing an nbsp make a difference? (PHP)

SpiritOffice

New Member
I have a script which opens a file then prints its contents (for a long, silly reason that doesn't bear explaining). The issue i have is, it often refuses to work, unless i echo some other text first. The code below doesn't work, but if i put\[code\]echo "a";\[/code\] or \[code\]echo "&nbsp;";\[/code\] first, it does. Even more strange, \[code\]echo " ";\[/code\] is insufficient.What does echoing some text do?\[code\]//...a bunch of code to get the file nameif(file_exists($file)) { $fp=fopen($file, "r"); $temp = fread( $fp, filesize($file)); echo $temp; } else { echo $file." not found<br /><br />"; }\[/code\]
 
Back
Top