note 39830 added to function.file

From: Date: Thu, 12 Feb 2004 07:45:40 +0000
Subject: note 39830 added to function.file
Groups: php.notes 
Request: Send a blank email to php-notes+get-65036@lists.php.net to get a copy of this message
this a little function I wrote that checks if two ascii files are the same. it opens the file then removes the spaces then coverts the crc32 to base 10 and compares the results. function fcheck($tool) { if(fopen("file.01", "r") != FALSE){ $fp1 = 'file.02'; $fp = 'semcond.01'; $data = implode(" ", file($fp)); $data1 = implode(" ", file($fp1)); $test1 = (dechex(crc32($data))); $test2 = (dechex(crc32($data1))); if($test1 == $test2) $sfv_checksum = 'TRUE'; else $sfv_checksum = 'FALSE'; return $sfv_checksum; } } ---- Manual Page -- http://www.php.net/manual/en/function.file.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39830 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39830&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39830&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#65036) next »