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

? ??? ?? PHP ???? ??? ??? ??? ???? PHP ?? ???? ???(???? ??)

??? ??? ??? ???? PHP ?? ???? ???(???? ??)

Jul 25, 2016 am 08:55 AM

  1. /**PHP ???? ???, ??? ?? ???? ??
  2. * ??: 2013-06-30
  3. * ???: fdipzone
  4. * ??: 1.0
  5. * ??: ww.jbxue.com
  6. * Func:
  7. * download: ?? ????
  8. * setSpeed: ???? ?? ??
  9. * getRange: ???? ?? ????
  10. */
  11. class FileDownload{ // ?? ??
  12. ??? $_speed = 512; // ???? ??
  13. /**Download
  14. * @param String $file ????? ?? ??
  15. * @param String $name ???, ?? ??? ????? ???? ??
  16. * @param boolean $reload ??? ?? ?? ??? ??
  17. */
  18. ?? ?? ????($file, $name='', $reload=false){
  19. if(file_exists($file) ){
  20. if($name==''){
  21. $name = basename($file);
  22. }
  23. $fp = fopen($file, 'rb');
  24. $file_size = ?? ??($file);
  25. $ranges = $this->getRange($file_size);
  26. header('cache-control:public');
  27. header('??? ??:?? ????/??-???');
  28. header('content-disposition:attachment; ?? ??='.$name);
  29. if($reload && $ranges!=null){ // ????
  30. header('HTTP/1.1 206 ?? ???');
  31. header('Accept-Ranges:bytes');
  32. // 剩余長(zhǎng)titude
  33. header(sprintf('content-length:%u',$ranges['end']-$ranges['start']));
  34. // ?? ??
  35. header(sprintf('content-range:bytes %s-%s/%s', $ranges['start'], $ranges['end'], $ ??_??));
  36. // fp指針跳到斷點(diǎn)位置
  37. fseek($fp, sprintf('%u', $ranges['start']));
  38. }else{
  39. header('HTTP/1.1 200 OK');
  40. header('content-length:'.$file_size);
  41. }
  42. while(!feof($fp)){
  43. echo fread($fp, round($this->_speed*1024,0));
  44. ob_flush();
  45. //??(1); // 于測(cè)試,減慢下載速degree
  46. }
  47. ($fp!=null) && fclose($fp);
  48. }else{
  49. return '';
  50. }
  51. }
  52. /**???? ?? ??
  53. * @param int $speed
  54. */
  55. ?? ?? setSpeed($speed){
  56. if(is_numeric($speed) && $speed>16 && $ ??<4096){
  57. $this->_speed = $speed;
  58. }
  59. }
  60. /**?? ?? ?? ????
  61. * @param int $file_size ?? ??
  62. * @return Array
  63. */
  64. ??? ?? getRange($file_size){
  65. if(isset($_SERVER['HTTP_RANGE']) && ! ????($_SERVER['HTTP_RANGE'])){
  66. $range = $_SERVER['HTTP_RANGE'];
  67. $range = preg_replace('/[s|,].*/', '', $range);
  68. $range =explod('-', substr($range, 6));
  69. if(count($range)<2){
  70. $range[1] = $file_size;
  71. }
  72. $range = array_combine(array('start','end'), $range);
  73. if(empty($range['start'])){
  74. $range['start'] = 0;
  75. }
  76. if(empty($range['end'])){
  77. $range['end'] = $file_size;
  78. }
  79. return $range;
  80. }
  81. null? ?????.
  82. }
  83. } // ?? ??
  84. ?>
復(fù)代碼

2,演示示例 ??. PHP

  1. require('FileDownload.class.php');
  2. $file = 'book.zip';
  3. $name = ??().'.zip';
  4. $obj = new FileDownload();
  5. $flag = $obj->download($file, $name);
  6. //$flag = $obj->download($file, $name, true); // 斷點(diǎn)續(xù)傳
  7. if(!$flag){
  8. echo '??? ????';
  9. }
  10. ?>
復(fù)代代碼

斷點(diǎn)續(xù)傳測(cè)試??: 使用linux wget命令去測(cè)試下載, wget -c -O ?? http://xxx

1,先關(guān)閉斷點(diǎn)續(xù)傳

  1. $flag = $obj->download($file, $name);
復(fù)主代碼

wget ??? ???? ??? ??? ??????.

  1. root@jbxue:~/Downloads$ wget -O test.rar http://demo.fdipzone.com/demo.php
  2. -- 2013-06-30 16:52:44-- http://demo.fdipzone.com/demo.php
  3. ??? ??.fdipzone.com ?? ?... 127.0.0.1
  4. demo.fdipzone? ?? ? . com|127.0.0.1|:80... ???????.
  5. HTTP ??? ?????? ??? ???? ?... 200 OK
  6. ??: 10445120(10.0M) [application/octet-stream]
  7. ?? ??: “test.rar”
  8. 30% [= ===========================> ] 3,146,580 513K/s ?? ?? 14?
  9. ^C
  10. root@jbxue :~/ ????$ wget -c -O test.rar http://demo.fdipzone.com/demo.php
  11. --2013-06-30 16:52:57-- http://demo.fdipzone .com/ ??.php
  12. ??? ??.fdipzone.com ?? ?... 127.0.0.1
  13. demo.fdipzone.com|127.0.0.1|:80 ?? ?... ???????.
  14. HTTP ??? ?????? ??? ???? ?... 200 OK
  15. ??: 10445120(10.0M) [application/octet-stream]
  16. ?? ??: “test.rar”
  17. 30% [= ==========================> ] 3,146,580 515K/s ?? ?? 14?
  18. ^C
?? ??

wget -c? ????? ???? ??? ? ??? ? ? ????.

2. ??? ??? ??????.

  1. $flag = $obj->download($file, $name, true);
?? ??

wget ??? ???? ?? ??? ??????.

  1. root@jbxue:~/Downloads$ wget -O test.rar http://demo.fdipzone.com/demo.php
  2. -- 2013-06-30 16:53:19-- http://demo.fdipzone.com/demo.php
  3. ??? ??.fdipzone.com ?? ?... 127.0.0.1
  4. demo.fdipzone? ?? ? . com|127.0.0.1|:80... ???????.
  5. HTTP ??? ?????? ??? ???? ?... 200 OK
  6. ??: 10445120(10.0M) [application/octet-stream]
  7. ?? ??: “test.rar”
  8. 20 % [==================> ] 2,097,720 516K/s ?? ?? 16?
  9. ^C
  10. root@jbxue:~/Downloads$ wget - c -O test.rar http://demo.fdipzone.com/demo.php
  11. --2013-06-30 16:53:31-- http://demo.fdipzone.com/demo.php
  12. ?? ? ??? ??.fdipzone.com... 127.0.0.1
  13. ?? ? ??.fdipzone.com|127.0.0.1|:80... ???????.
  14. HTTP ?? ???, ?? ?? ?... 206 ?? ???
  15. ??: 10445121(10.0M), 7822971(7.5M) ?? ??? [application/octet-stream]
  16. ?? ??: "test. rar"
  17. 100%[ ===============================>] 10,445,121 543K /s 14? ??
  18. 2013-06-30 16:53:45 (543 KB/s) - "test.rar" ??? [10445121/10445121])
?? ??

??? ??( )?? ????? ???? ?? ??? ? ????.

PHP ?? ???? ???? ???? ???? ?? ??(??????? ??? ???? ??)



? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? 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)

???

??? ??

?? ????
1742
16
Cakephp ????
1596
56
??? ????
1536
28
PHP ????
1396
31
???
PHP ?? API ????? ?? ??? ?????? PHP ?? API ????? ?? ??? ?????? Jun 14, 2025 am 12:27 AM

ToversionAphp ??, forclarityandeasofrouting, ac

PHP?? ?? ? ??? ????? ????????? PHP?? ?? ? ??? ????? ????????? Jun 20, 2025 am 01:03 AM

TOSECURELYHANDLEAUSTENCENDACTIONANDACTERIZINGINPHP, FORCUCTSESTEPS : 1. ALWAYSHASHPASSWORTHPASSWORD_HASH () ? VERVERIFYUSINGPANSWORD_VERIFY (), usePREPAREDSTATEMENTSTOPREVENTSQLINGERGED, andSTOREUSERSESSEATAIN $ _SESSIONSAFTERLOGIN.2.impleplempletrole ?? ACCESSC

PHP? ?? ? ?? ?? ????? ????? ???? ?????? PHP? ?? ? ?? ?? ????? ????? ???? ?????? Jun 14, 2025 am 12:25 AM

ProceduralAndObject-OrientedProgramming (OOP) InphpDiffersiMINTIFINTIONTERINGLISTURE, ??? ? ? DATAHANDLING

PHP? ?? ?? (??)? ???? ?? ?? ? ? ????? PHP? ?? ?? (??)? ???? ?? ?? ? ? ????? Jun 14, 2025 am 12:25 AM

phpdoesnothaveAbuilt-inweakMapButofferSweakReference.1.WeakReenceAllowsholdingReferences withoutpreventinggarbageCollection.2.ItusteForCaching, Eventlisteners, andMetAdataWithoutAftingObjectLifeCycles.3.youcoucococococococcinccing

PHP?? ?? ???? ??? ??? ?? ? ? ??????? PHP?? ?? ???? ??? ??? ?? ? ? ??????? Jun 19, 2025 am 01:05 AM

PHP?? ?? ???? ???? ????? ??? ?? ??? ???? ?? ??? ??? ??? ???? ????. 1. finfo_file ()? ???? ?? ?? ??? ???? ???/jpeg? ?? ?? ?? ? ?????. 2. uniqid ()? ???? ??? ?? ??? ???? ? Web ?? ????? ??????. 3. php.ini ? html ??? ?? ?? ??? ???? ???? ??? 0755? ?????. 4. Clamav? ???? ???? ???? ??? ??????. ??? ??? ?? ???? ????? ???? ?? ??? ????? ???? ??? ? ??? ?????.

PHP?? == (??? ??)? === (??? ??)? ???? ?????? PHP?? == (??? ??)? === (??? ??)? ???? ?????? Jun 19, 2025 am 01:07 AM

PHP?? ==? ==? ?? ???? ?? ??? ??????. == ?? ??? ?? ?? ?????. ?? ??, 5 == "5"? true? ????, ?? ??? ???? ?? ?? ??? ????? ????? (? : 5 === "5"? false? ?????. ?? ?????? ===? ? ???? ?? ?????? == ?? ??? ??? ???? ?????.

PHP? NOSQL ?????? (? : MongoDB, Redis)? ??? ?? ??? ? ????? PHP? NOSQL ?????? (? : MongoDB, Redis)? ??? ?? ??? ? ????? Jun 19, 2025 am 01:07 AM

?, PHP? ?? ?? ?? ?????? ?? MongoDB ? Redis? ?? NOSQL ??????? ?? ??? ? ????. ?? MongoDBPHP ???? (PECL ?? Composer? ?? ??)? ???? ????? ????? ??? ?????? ? ???? ????? ??, ??, ?? ? ?? ??? ?????. ??, Predis ????? ?? Phpredis ??? ???? Redis? ???? ?? ? ?? ? ??? ???? ??? ????? Phpredis? ???? ?? Predis? ?? ??? ?????. ? ? ?? ??? ???? ? ????? ????.

php (, -, *, /, %)?? ?? ??? ??? ?????? php (, -, *, /, %)?? ?? ??? ??? ?????? Jun 19, 2025 pm 05:13 PM

PHP?? ?? ??? ??? ???? ??? ??? ????. 1. ?? ??? ?? ? ?? ??? ??? ???? ???? ??? ? ????. ??? ??? ???? ????? ????? ???? ????. 2. ?? ?? ?? - ??, ??? ???? ?? ??? ?????. 3. ?? ???? ??? ??? ???? ??? ??? ?????. 4. Division? / ??? ???? 0?? ??? ?? ????? ??? ?? ??? ?? ? ? ????. 5. ???? ??? ???? ?? ?? ? ?? ??? ???? ? ??? ? ???, ??? ?? ? ? ??? ??? ???? ?????. ? ???? ???? ???? ??? ??? ??? ???? ?? ??? ? ??????? ????.

See all articles