国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? PHP ???? PHP ZIP ?? ??? ?? ??

PHP ZIP ?? ??? ?? ??

Jul 25, 2016 am 09:13 AM

??: ??? zip ?? rar ????? ?????. ??? ??? ??? ??? ? ????. ???: ?? ?????? ?? ????? ?????. ? ?? ????. ? ??? ?? ?? ?????. ? ??? ??? ?? ??? ??? ?? ?????.

PHP zip ?? ???? ???? ??:

  1. $zipfiles =array("/root/pooy/test1.txt","/root/pooy/test2.txt ");
  2. $z = ??? PHPZip();
  3. //$randomstr = ???(8);
  4. $zipfile = TEMP."/photocome_".$groupid.".zip";
  5. $z->Zip($zipfiles, $zipfile); //?? ?? ??
?? ??

PHP? ZIP ?? ???:

  1. #

  2. # PHPZip v1.2 by Sext(sext@neud.net) 2002-11 -18
  3. # (???: 2003-03-01)
  4. #
  5. # zip ???? ??
  6. #
  7. # "Zip ?? ?? ???" ???? zLib ??
  8. #
  9. #
  10. class PHPZip
  11. {
  12. function Zip($dir, $zipfilename)
  13. {
  14. if (@function_exists('gzcompress'))
  15. {
  16. $curdir = getcwd();
  17. if (is_array($dir))
  18. {
  19. $filelist = $dir;
  20. }
  21. else
  22. {
  23. $filelist = $this - > GetFileList($dir);
  24. }

  25. if ((!empty($dir))&&(!is_array($dir))&&(file_exists($dir))) chdir($dir);

  26. else chdir($curdir);

  27. if (count($filelist)>0)

  28. {
  29. foreach($filelist as $filename)
  30. {
  31. if (is_file($filename))
  32. {
  33. $fd = fopen($filename, "r");
  34. $content = fread($fd, ?? ??($filename));
  35. fclose($fd);

  36. if (is_array($dir)) $filename = basename($filename);

  37. $this -> addFile($content, $filename);
  38. }
  39. }
  40. $out = $this -> ??();

  41. chdir($curdir);

  42. $fp = fopen($zipfilename, "w");
  43. fwrite($fp, $out, strlen($out));
  44. fclose($fp);
  45. }
  46. 1? ??;
  47. }
  48. ??? ??? 0? ??;
  49. }

  50. function GetFileList($dir)

  51. {
  52. if (file_exists($dir))
  53. {
  54. $args = func_get_args();
  55. $pref = $args[1];
  56. $dh = opendir($dir);

  57. while($files = readdir($dh))
  58. {
  59. if (($files!=".")&&($files!=".. "))
  60. {
  61. if (is_dir($dir.$files))
  62. {
  63. $curdir = getcwd();
  64. chdir($dir.$files);
  65. $file = array_merge($file, $this -> GetFileList("", "$pref$files/"));
  66. chdir($curdir);
  67. }
  68. else $file[]= $pref.$files;
  69. }
  70. }
  71. closeir($dh);
  72. }
  73. return $file;
  74. }

  75. var $datasec = array();

  76. var $ctrl_dir = array();
  77. var $eof_ctrl_dir = "x50x4bx05x06x00x00x00x00";
  78. var $old_offset = 0;

  79. * Unix ?????? 4??? DOS ?? ? ?? ???? ?????(date
  80. *? ?? 2???, ??? ?? ??? ????? ?? 2???).
  81. *
  82. * @param ?? ?? Unix ?????
  83. *
  84. * @return ?? 4??? DOS ??? ?? ??
  85. *
  86. * @access private
  87. */
  88. function unix2DosTime($unixtime = 0) {
  89. $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);

  90. if ($timearray['??'] < 1980) {

  91. $timearray['??'] = 1980;
  92. $timearray['mon'] = 1;
  93. $timearray['mday'] = 1;
  94. $timearray['hours'] = 0;
  95. $timearray['?'] = 0;
  96. $timearray['seconds'] = 0;
  97. } // end if< ;/p>
  98. return (($timearray['??'] - 1980) ($timearray['hours'] }// 'unix2DosTime()' ???? ?

  99. /**

  100. * ????? "??" ??
  101. *
  102. * @param ??? ?? ??
  103. * @param ??? ????? ?? ?? ??(??? ??? ? ??)
  104. * @param ?? ?? ?????
  105. *
  106. * @access public
  107. */
  108. function addFile($data, $name, $time = 0)
  109. {
  110. $name = str_replace('\', '/', $name);< ;/p>
  111. $dtime = decex($this->unix2DosTime($time));

  112. $hexdtime = 'x' . $dtime[6] . $dtime[7]
  113. ??? ??? ??? . '??' . $dtime[4] . $dtime[5]
  114. . '??' . $dtime[2] . $dtime[3]
  115. . '??' . $dtime[0] . $dtime[1];
  116. eval('$hexdtime = "' . $hexdtime . '";');

  117. $fr = "x50x4bx03x04";

  118. $fr .= "x14x00"; //
  119. ? ???? ? ??? ?? $fr .= "x00x00"; // ?? ?? ?? ???
  120. $fr .= "x08x00"; // ?? ??
  121. $fr .= $hexdtime; // ??? ?? ?? ? ??

  122. // "?? ?? ??" ????

  123. $unc_len = strlen($data);
  124. $crc = crc32($data);
  125. $zdata = gzcompress($data);
  126. $c_len = strlen($zdata);
  127. $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // crc ?? ??
  128. $fr .= pack('V', $crc); // crc32
  129. $fr .= pack('V', $c_len); // ??? ?? ??
  130. $fr .= pack('V', $unc_len); // ???? ?? ?? ??
  131. $fr .= pack('v', strlen($name)); // ?? ?? ??
  132. $fr .= pack('v', 0); // ?? ?? ??
  133. $fr .= $name;

  134. // "?? ???" ????

  135. $fr .= $zdata;

  136. // "??? ???" ????(?? ????? ????? ?? ?? ???

  137. // ??? ???)
  138. $fr .= pack('V', $crc); // crc32
  139. $fr .= pack('V', $c_len); // ??? ?? ??
  140. $fr .= pack('V', $unc_len); // ???? ?? ?? ??

  141. // ? ??? ??? ??

  142. $this -> datasec[] = $fr;
  143. $new_offset = strlen(implode('', $this->datasec));

  144. // ?? ?? ???? ???? ??

  145. $cdrec = "x50x4bx01x02";
  146. $cdrec .= "x00x00"; // ???
  147. $cdrec .= "x14x00"; // ??? ??? ??
  148. $cdrec .= "x00x00"; // ?? ?? ?? ???
  149. $cdrec .= "x08x00"; // ?? ??
  150. $cdrec .= $hexdtime; // ??? ?? ?? ? ??
  151. $cdrec .= pack('V', $crc); // crc32
  152. $cdrec .= pack('V', $c_len); // ??? ?? ??
  153. $cdrec .= pack('V', $unc_len); // ???? ?? ?? ??
  154. $cdrec .= pack('v', strlen($name) ); // ?? ?? ??
  155. $cdrec .= pack('v', 0 ); // ?? ?? ??
  156. $cdrec .= pack('v', 0 ); // ?? ?? ??
  157. $cdrec .= pack('v', 0 ); // ??? ?? start
  158. $cdrec .= pack('v', 0 ); // ?? ?? ??
  159. $cdrec .= pack('V', 32 ); // ?? ?? ?? - '????' ?? ??

  160. $cdrec .= pack('V', $this -> old_offset ); // ?? ??? ?? ???

  161. $this -> old_offset = $new_offset;

  162. $cdrec .= $name;

  163. // ???? ?? ??, ?? ??? ??? ?????

  164. // ?? ????? ??
  165. $this -> ctrl_dir[] = $cdrec;
  166. }// 'addFile()' ??? ?

  167. /**

  168. * ?? ??
  169. *
  170. * @return ??? ?? ???
  171. *
  172. * @access public
  173. */
  174. ?? ??()
  175. {
  176. $data = implode('', $this -> datasec);
  177. $ctrldir = implode('', $ ? -> ctrl_dir);

  178. return

  179. $data .
  180. $ctrldir .
  181. $this -> eof_ctrl_dir .
  182. pack('v', sizeof($this -> ctrl_dir)) . // "? ???? ??" ??? ? ??
  183. pack('v', sizeof($this -> ctrl_dir)) . // ?? ??? ? ??
  184. pack('V', strlen($ctrldir)) . // ?? dir
  185. ? ?? pack('V', strlen($data)) . // ?? ????? ?? ???
  186. "x00x00"; // .zip ?? ?? ??
  187. } // 'file()' ???? ?

  188. } // 'PHPZip' ???? ?

  189. ?>< ;/p>
????

??? PHP zip壓縮類, 個人感還是不錯的,里數(shù)多php實用函數(shù)的應(yīng)用技巧,特別是函數(shù)pack、crc32、gzcompress等函數(shù)?應(yīng)用,值得school習(xí)借鑒。



? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
PHP ?? ??? ??????? PHP ?? ??? ??????? Jul 17, 2025 am 04:16 AM

PHP ?? ??? ?? ???? ?? ? ????? ??? ?????. 1. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

PHP?? ?? ???? ???? ???? ??? ?????? PHP?? ?? ???? ???? ???? ??? ?????? Jul 08, 2025 am 02:37 AM

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP?? ?? ?? PHP?? ?? ?? Jul 18, 2025 am 04:57 AM

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

PHP ?? ?? ? PHP ?? ?? ? Jul 18, 2025 am 04:51 AM

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

PHP?? ???? ??? ?????? PHP?? ???? ??? ?????? Jul 11, 2025 am 03:12 AM

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

?? PHP : ??? ??? ?? PHP : ??? ??? Jul 18, 2025 am 04:54 AM

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled

PHP?? ??? ? ???? ??? ????? ?? PHP?? ??? ? ???? ??? ????? ?? Jul 12, 2025 am 03:15 AM

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.

?? PHP ?? ??? ?? PHP ?? ??? Jul 18, 2025 am 04:52 AM

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2

See all articles