This article mainly introduces how to split the file of PHP breakpoint, the need for friends can refer to the following
Code as follows: <?php ini_set ("Memory_limit", "50M");/must, according to the actual situation of your environment as large as possible, to prevent errors ini_set ("Max_execution_ Time ","; ") the//file_exists () function checks whether a file or directory exists, returns True if it exists, or returns false. The //fread () function reads files (which are safe for binary files). Fread () reads up to length bytes from file pointer files. The //filesize () function returns the size (in bytes) of the specified file. The result of this function is cached. Please use Clearstatcache () to clear the cache. $orgFile = ' fireworks8-chs.exe ';//source file $cacheFileName = ' vbcache ';//Split temporary file block function Cutfile ($ FileName, $block) {//split global $cacheFileName; if (!file_exists ($fileName)) return false; $num = 1;& nbsp $file = fopen ($fileName, ' RB '); while ($content = Fread ($file, $block)) { $cacheFile = $cacheFileName. $num + + . '. Dat '; $cfile = fopen ($cacheFile, ' WB '); fwrite ($cfile, $content); fclose ($cfile); } Fclose ($file); } function Mergefile ($targetFile) {//merge global $cacheFileName; $num = 1; $ File = fopen ($targetFile, ' WB '); while ($num > 0) { $cacheFile = $cacheFileName. $num + +. '. Dat '; if (file_exists ($cacheFile)) { $cfile = fopen ($cacheFile, ' RB '); $content = fread ($cfile, files Ize ($cacheFile)); fclose ($cfile); fwrite ($file, $content); } else { $num = -1; }& nbsp } fclose ($file); } //Call Cutfile ($orgFile, pow (2,20)); The * POW (2,20) equals the 10M Pow () function returns X's y mergefile (' Ok.exe '); ?>