| |||||||||||
| |||||||||||
PHP fread - truncated data
Note that PHP's fread function returns the number of bytes you request as the second parameter ...OR the number of remaining bytes if it's less than the number you give ... or 8192 bytes, even if there's more than that available and you've requested more.
I got caught out by this one earlier today ... felt that it was useful (re)minder to post it up here. If you need to read more that 8k into a variable: while ($info = fread($fh,8192)) {(written 2007-02-27 15:21:48) Associated topics are indexed under H109 - PHP - Input / Output
Some other Articles
Three big events - TWSW, Business of the year and the policeTrain and business balls all in the air! Sample script - FTP to get a file from within PHP Apache httpd , browser, MySQL and MySQL client downloads PHP fread - truncated data Wiltshire Train - can YOU come on 5th March? Tcl training - often for a larger group The Psyche is all wrong. Too many instructions, too much detail Playing old games 1696 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||