note 110312 deleted from function.fgetc by mazzanet

From: Date: Wed, 10 Oct 2012 01:04:37 +0000
Subject: note 110312 deleted from function.fgetc by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-191224@lists.php.net to get a copy of this message
Note Submitter: my_backup at live dot nl ---- After having answered this question many times, I decided it should become available at the source of it all. When echoing a php or .net file with fgetc, or any of the file methods for that matter, it happens frequently that the screen turns up empty or showing half of the expected data. This is due to a browser ( Chrome ) detecting < and > in <?php and ?> as a valid html tag. It therefore does not show the data between the php opening tag and the first occurence of > in your file. To prove this theory, fetch the source of the page and note that the section not shown is marked green. Green means comment, do not show, not intended for output. Therefore you end up with an unexpected outcome. Mystery solved. A fairly easy way to counteract this, would be to add //> just after the php opening tag. Hope this helps someone.

« previous php.notes (#191224) next »