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

? ??? ?? PHP ???? PHP FTP ?? ???(?? ???, ??, ??, ??/???? ??)

PHP FTP ?? ???(?? ???, ??, ??, ??/???? ??)

Jul 25, 2016 am 08:46 AM

  1. /**
  2. * 作用:FTP操作類( 拷貝、移動(dòng)、刪除文件/創(chuàng)建目錄 )
  3. * 時(shí)間:2006/5/9
  4. * 作者:欣然隨風(fēng)
  5. * QQ:276624915
  6. */
  7. class class_ftp
  8. {
  9. public $off; // 返回操作狀態(tài)(成功/失敗)
  10. public $conn_id; // FTP連接
  11. /**
  12. * 方法:FTP連接
  13. * @FTP_HOST -- FTP主機(jī)
  14. * @FTP_PORT -- 端口
  15. * @FTP_USER -- 用戶名
  16. * @FTP_PASS -- 密碼
  17. */
  18. function __construct($FTP_HOST,$FTP_PORT,$FTP_USER,$FTP_PASS)
  19. {
  20. $this->conn_id = @ftp_connect($FTP_HOST,$FTP_PORT) or die("FTP服務(wù)器連接失敗");
  21. @ftp_login($this->conn_id,$FTP_USER,$FTP_PASS) or die("FTP服務(wù)器登陸失敗");
  22. @ftp_pasv($this->conn_id,1); // 打開(kāi)被動(dòng)模擬
  23. }
  24. /**
  25. * 方法:上傳文件
  26. * @path -- 本地路徑
  27. * @newpath -- 上傳路徑
  28. * @type -- 若目標(biāo)目錄不存在則新建
  29. */
  30. function up_file($path,$newpath,$type=true)
  31. {
  32. if($type) $this->dir_mkdirs($newpath);
  33. $this->off = @ftp_put($this->conn_id,$newpath,$path,FTP_BINARY);
  34. if(!$this->off) echo "文件上傳失敗,請(qǐng)檢查權(quán)限及路徑是否正確!";
  35. }
  36. /**
  37. * 方法:移動(dòng)文件
  38. * @path -- 原路徑
  39. * @newpath -- 新路徑
  40. * @type -- 若目標(biāo)目錄不存在則新建
  41. */
  42. function move_file($path,$newpath,$type=true)
  43. {
  44. if($type) $this->dir_mkdirs($newpath);
  45. $this->off = @ftp_rename($this->conn_id,$path,$newpath);
  46. if(!$this->off) echo "文件移動(dòng)失敗,請(qǐng)檢查權(quán)限及原路徑是否正確!";
  47. }
  48. /**
  49. * 方法:復(fù)制文件
  50. * 說(shuō)明:由于FTP無(wú)復(fù)制命令,本方法變通操作為:下載后再上傳到新的路徑
  51. * @path -- 原路徑
  52. * @newpath -- 新路徑
  53. * @type -- 若目標(biāo)目錄不存在則新建
  54. */
  55. function copy_file($path,$newpath,$type=true)
  56. {
  57. $downpath = "c:/tmp.dat";
  58. $this->off = @ftp_get($this->conn_id,$downpath,$path,FTP_BINARY);// 下載
  59. if(!$this->off) echo "文件復(fù)制失敗,請(qǐng)檢查權(quán)限及原路徑是否正確!";
  60. $this->up_file($downpath,$newpath,$type);
  61. }
  62. /**
  63. * 方法:刪除文件
  64. * @path -- 路徑
  65. */
  66. function del_file($path)
  67. {
  68. $this->off = @ftp_delete($this->conn_id,$path);
  69. if(!$this->off) echo "文件刪除失敗,請(qǐng)檢查權(quán)限及路徑是否正確!";
  70. }
  71. /**
  72. * 方法:生成目錄
  73. * @path -- 路徑
  74. */
  75. function dir_mkdirs($path)
  76. {
  77. $path_arr = explode('/',$path); // 取目錄數(shù)組
  78. $file_name = array_pop($path_arr); // 彈出文件名
  79. $path_div = count($path_arr); // 取層數(shù)
  80. foreach($path_arr as $val) // 創(chuàng)建目錄
  81. {
  82. if(@ftp_chdir($this->conn_id,$val) == FALSE)
  83. {
  84. $tmp = @ftp_mkdir($this->conn_id,$val);
  85. if($tmp == FALSE)
  86. {
  87. echo "目錄創(chuàng)建失敗,請(qǐng)檢查權(quán)限及路徑是否正確!";
  88. exit;
  89. }
  90. @ftp_chdir($this->conn_id,$val);
  91. }
  92. }
  93. for($i=1;$i=$path_div;$i ) // 回退到根
  94. {
  95. @ftp_cdup($this->conn_id);
  96. }
  97. }
  98. /**
  99. * 方法:關(guān)閉FTP連接
  100. */
  101. function close()
  102. {
  103. @ftp_close($this->conn_id);
  104. }
  105. }// class class_ftp end
  106. /************************************** 測(cè)試 ***********************************
  107. $ftp = new class_ftp('192.168.100.143',21,'user','pwd'); // 打開(kāi)FTP連接
  108. //$ftp->up_file('aa.txt','a/b/c/cc.txt'); // 上傳文件
  109. //$ftp->move_file('a/b/c/cc.txt','a/cc.txt'); // 移動(dòng)文件
  110. //$ftp->copy_file('a/cc.txt','a/b/dd.txt'); // 復(fù)制文件
  111. //$ftp->del_file('a/b/dd.txt'); // 刪除文件
  112. $ftp->close(); // 關(guān)閉FTP連接
  113. ******************************************************************************/
  114. ?>
復(fù)制代碼

PHP, FTP


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