fread( ) is good for when you only care about a small part of the file. : fread « File Directory « PHP






fread( ) is good for when you only care about a small part of the file.

 
<?
    $zipfile = fopen("data.zip", "r");
    if (fread($zipfile, 2) != "PK") {
      print "Data.zip is not a valid Zip file!";

    }
    fclose($zipfile);
?>
  
  








Related examples in the same category

1.Reading a file
2.fread() function reads up to length bytes from the file, returning the file's contents.
3.fread.php
4.fopen( ) and fread( )
5.Reading and Writing Binary Data in a File