note 110312 added to function.fgetc

From: Date: Wed, 10 Oct 2012 00:22:07 +0000
Subject: note 110312 added to function.fgetc
Groups: php.notes 
Request: Send a blank email to php-notes+get-191221@lists.php.net to get a copy of this message
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. ---- Server IP: 69.147.83.199 Probable Submitter: 83.86.148.155 ---- Manual Page -- http://www.php.net/manual/en/function.fgetc.php Edit -- https://master.php.net/note/edit/110312 Del: integrated -- https://master.php.net/note/delete/110312/integrated Del: useless -- https://master.php.net/note/delete/110312/useless Del: bad code -- https://master.php.net/note/delete/110312/bad+code Del: spam -- https://master.php.net/note/delete/110312/spam Del: non-english -- https://master.php.net/note/delete/110312/non-english Del: in docs -- https://master.php.net/note/delete/110312/in+docs Del: other reasons-- https://master.php.net/note/delete/110312 Reject -- https://master.php.net/note/reject/110312 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#191221) next »