note 87030 added to wrappers

From: Date: Sat, 15 Nov 2008 19:07:45 +0000
Subject: note 87030 added to wrappers
Groups: php.notes 
Request: Send a blank email to php-notes+get-146583@lists.php.net to get a copy of this message
Not exactly sure why this was the solution, but if you are trying to fopen("php://input", "r") and then wanting to print out the contents of the stream, you cannot do this: <? $putdata = fopen("php://input", "r"); while ($data = fread($putdata, 1024)) { print $data; } ?> On the above code, for some reason seemed to be stuck in an endless loop. Im a noob, so I don't know why this was happening.... BUT, this is what worked for me <? $fp = fopen('php://input','r'); print stream_get_contents($fp); ?> ---- Server IP: 209.41.74.194 Probable Submitter: 69.154.160.110 ---- Manual Page -- http://www.php.net/manual/en/wrappers.php Edit -- https://master.php.net/note/edit/87030 Del: integrated -- https://master.php.net/note/delete/87030/integrated Del: useless -- https://master.php.net/note/delete/87030/useless Del: bad code -- https://master.php.net/note/delete/87030/bad+code Del: spam -- https://master.php.net/note/delete/87030/spam Del: non-english -- https://master.php.net/note/delete/87030/non-english Del: in docs -- https://master.php.net/note/delete/87030/in+docs Del: other reasons-- https://master.php.net/note/delete/87030 Reject -- https://master.php.net/note/reject/87030 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146583) next »