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

? ??? ?? PHP ???? ??? ??? ??? ???? ?? ???? PHP ??? ??

??? ??? ??? ???? ?? ???? PHP ??? ??

Jul 25, 2016 am 08:42 AM

???, PHP?? ??? ??

? ??? ???? ??? ??? ????? ???? PHP? ??? ?? ???? ???? ? ???? ?????. ??? ? ??? ?? ??? ?????. ???? ??? ??? ????.

????? PHP? ?? HTTP ????? HTTP_RANGE ??? ???? ??? ??? ?????.

HTTP ??? ?? ??:

Http ?? Range, Content-Range()
HTTP ???? Range ? Content-Range ??? ??? ????? ??? ????? ?????.
Range ??? ?? ???? ? ?? ??? ??? ?????. (Range: 200-300)
Content-Range? ?? ??? ?????

?? ?? ???? ??:

GET /test.rar HTTP/1.1
??: close
???: 116.1.219.219
??: bytes=0-801 //?? ??? ?????? ?? ?? ??? bytes=0- ?? ? ??? ???? ???

?? ??:

HTTP/1.1 200 OK
Content-Length: 801
Content-Type: application/octet-stream
Content-Range: ??? 0-800/801 //801: ? ?? ??

FileDownload.class.php ??? ?? ??? ??? ????.

  1. /**
  2. * ???? ???, ??? ??? ???? ??
  3. * @time: 2015 06 30 09:36
  4. * @author:guoyu@xzdkiosk.com
  5. * PHP ???? ???, ??? ??? ???? ??
  6. * Func:
  7. * download: ?? ????
  8. * setSpeed: ???? ?? ??
  9. * getRange: ??? ?? ????
  10. */
  11. class FileDownload{ // ??? ??
  12. private $_speed = 512; // ???? ??
  13. /**Download
  14. * @param String $file ????? ?? ??
  15. * @param String $name ???, ?? ??? ????? ???? ??
  16. * @param boolean $reload ??? ?? ?? ??? ??
  17. */
  18. public ?? download($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 = filesize($file)
  25. $ranges = $this->getRange($file_size); ??>
  26. header('cache-control:public');
  27. header('content-type:application/octet-stream')
  28. header('content-disposition:attachment; filename='. $name );
  29. if($reload && $ranges!=null){ // ??
  30. ??('HTTP/1.1 206 ?? ???')
  31. header('Accept-Ranges : bytes');
  32. // ?? ??
  33. header(sprintf('content-length:%u',$ranges['end']-$ranges['start']))
  34. // ?? ??
  35. header(sprintf('content-range:bytes %s-%s/%s', $ranges['start'], $ranges['end'], $file_size ) ); // fp ???? ??? ??? ?????.
  36. fseek($fp, sprintf('%u', $ranges['start']))
  37. }else{
  38. header('HTTP/1.1 200 OK');
  39. header('content-length:'.$file_size)
  40. }
  41. while(!feof($fp)){
  42. echo fread($fp, round($this->_speed*1024,0));
  43. ob_flush()
  44. //sleep(1) // ?????? ??, ???? ?? ?? ??
  45. }
  46. ($fp!=null) && fclose($fp)
  47. }else{
  48. return ''; ??>
  49. /**???? ?? ??
  50. * @param int $speed
  51. */
  52. ?? ?? setSpeed($speed){
  53. if(is_numeric($speed) && $speed>16 && $speed<4096){
  54. $ this- >_speed = $speed;
  55. }
  56. }
  57. /**?? ?? ?? ????
  58. * @param int $file_size ?? ??
  59. * @return Array
  60. */
  61. ??? ?? getRange($file_size){
  62. if(isset($ _SERVER[ 'HTTP_RANGE']) && !empty($_SERVER['HTTP_RANGE'])){
  63. $range = $_SERVER['HTTP_RANGE']
  64. $range = preg_replace('/[s|,] .* /', '', $range)
  65. $range =explosion('-', substr($range, 6))
  66. if(count($range)<2){
  67. $ range[1] = $file_size;
  68. }
  69. $range = array_combine(array('start','end'), $range)
  70. if(empty($range['start') ]) ){
  71. $range['start'] = 0;
  72. }
  73. if(empty($range['end'])){
  74. $range['end'] = $ file_size;
  75. }
  76. return $range;
  77. }
  78. return null
  79. }
  80. } // ??? ??
  81. ?? ??

?? ??? ??? ????.
  1. require('FileDownload.class.php')
  2. $file = 'book.zip ';
  3. $name = time().'.zip'; $obj = new FileDownload()
  4. $flag = $obj->download($file, $name); > / /$flag = $obj->download($file, $name, true); // ??? ??
  5. if(!$flag){
  6. echo '??? ????'; ??> }
  7. ?>
  8. ?? ??
?? ??? ???? ??? ??:

linux wget ??? ???? ????? ??????. wget -c -O ?? http://xxx

1. ?? ??? ??? ???

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

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

2. ??? ?? ???

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

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



? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? 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 11, 2025 am 03:12 AM

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

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

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

?? 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