fopen
| From: | John Taylor-Johnston | Date: | Wed, 26 Oct 2005 04:54:37 +0000 |
| Subject: | fopen | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224660@lists.php.net to get a copy of this message | ||
It does what I want, but I worry 4096 may not be big enough. Possible? Is there a way to detect the filesize and insert a value for 4096?
$buffer = fgets($dataFile, $filesize);
Is this what it is for?
John
<?php
#http://ca3.php.net/fopen
$filename = "/var/www/html2/assets/about.htm" ;
$dataFile = fopen( $filename, "r" ) ;
while (!feof($dataFile))
{
$buffer = fgets($dataFile, 4096);
echo $buffer;
}
$sql = "insert into table ... $buffer";
?>