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

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

PHP ?? ?? ???

Jul 25, 2016 am 09:11 AM

本類為文件操作類,實現(xiàn)了文件的建立,寫入,刪除,修改,復制,移動,創(chuàng)建目錄,刪除目錄
  1. /**
  2. *本類為文件操作類,實現(xiàn)了文件的建立,寫入,刪除,修改,復制,移動,創(chuàng)建目錄,刪除目錄
  3. * 列出目錄里的文件等功能,路徑后面別忘了加"/"
  4. *
  5. * @author 路人郝
  6. * @copyright myself
  7. * @link www.phpr.cn
  8. *
  9. */
  10. class fileoperate
  11. {
  12. var path;// 文件路徑
  13. var name;//文件名
  14. var result;//對文件操作后的結(jié)果
  15. /**
  16. * 本方法用來在path目錄下創(chuàng)建name文件
  17. *
  18. * @param string path
  19. * @param string name
  20. */
  21. function creat_file(path,name)//建立文件
  22. {
  23. filename=path.name;
  24. if (file_exists(filename))
  25. {
  26. echo "文件已經(jīng)存在,請換個文件名";
  27. }
  28. else
  29. {
  30. if (file_exists(path))
  31. {
  32. touch(name);
  33. rename(name,filename);
  34. echo "文件建立成功
    ";
  35. }
  36. else{
  37. echo "目錄不存在,請檢查";
  38. }
  39. }
  40. }
  41. /**
  42. * 本方法用來寫文件,向path路徑下name文件寫入content內(nèi)容,bool為寫入選項,值為1時
  43. * 接著文件原內(nèi)容下繼續(xù)寫入,值為2時寫入后的文件只有本次content內(nèi)容
  44. *
  45. * @param string_type path
  46. * @param string_type name
  47. * @param string_type content
  48. * @param bool_type bool
  49. */
  50. function write_file(path,name,content,bool) //寫文件
  51. {
  52. filename=path.name;
  53. if (bool==1) {
  54. if (is_writable(filename)) {
  55. handle=fopen(filename,'a');
  56. if (!handle) {
  57. echo "文件不能打開或文件不存在";
  58. exit;
  59. }
  60. result=fwrite(handle,content);
  61. if (!result) {
  62. echo "文件寫入失敗";
  63. }
  64. echo "文件寫入成功";
  65. fclose(handle);
  66. }
  67. else echo "文件不存在";
  68. }
  69. if (bool==2) {
  70. if (!file_exists(filename)) {
  71. this->creat_file(path,name);
  72. handle=fopen(filename,'a');
  73. if (fwrite(handle,content));
  74. echo "文件寫入成功";
  75. }
  76. else {
  77. unlink(filename);
  78. this->creat_file(path,name);
  79. this->write_file(path,name,content,1);
  80. echo "文件修改成功";
  81. }
  82. }
  83. }
  84. /**
  85. * 本方法刪除path路徑下name文件
  86. *
  87. * @param string_type path
  88. * @param string_type name
  89. */
  90. function del_file(path,name){ //刪除文件
  91. filename=path.name;
  92. if (!file_exists(filename)) {
  93. echo "文件不存在,請確認路徑是否正確";
  94. }
  95. else {
  96. if (unlink(filename)){
  97. echo "文件刪除成功";
  98. }
  99. else echo "文件刪除失敗";
  100. }
  101. }
  102. /**
  103. * 本方法用來修改path目錄里name文件中的內(nèi)容(可視)
  104. *
  105. * @param string_type path
  106. * @param string_type name
  107. */
  108. function modi_file(path,name){ //文件修改
  109. filename=path.name;
  110. handle=fopen(filename,'r ');
  111. content=file_get_contents(filename);
  112. echo "
    ";
  113. echo "文件內(nèi)容";
  114. echo "

    ";

  115. echo "文件路徑

    ";

  116. echo "";
  117. echo "";
  118. }
  119. /**
  120. * 本方法用來復制name文件從spath到dpath
  121. *
  122. * @param string name
  123. * @param string spath
  124. * @param string dpath
  125. */
  126. function copy_file(name,spath,dpath) //文件復制
  127. {
  128. filename=spath.name;
  129. if (file_exists(filename)) {
  130. handle=fopen(filename,'a');
  131. copy(filename,dpath.name);
  132. if (file_exists(dpath.name))
  133. echo "文件復制成功";
  134. else echo "文件復制失敗";
  135. }
  136. else echo "文件不存在";
  137. }
  138. /**
  139. * 本方法把name文件從spath移動到path路徑
  140. *
  141. * @param string_type path
  142. * @param string_type dirname
  143. * @param string_type dpath
  144. */
  145. function move_file(name,spath,dpath) //移動文件
  146. {
  147. filename=spath.name;
  148. if (file_exists(filename)) {
  149. result=rename(filename,dpath.name);
  150. if (result==false or !file_exists(dpath))
  151. echo "文件移動失敗或目的目錄不存在";
  152. else
  153. echo "文件移動成功";
  154. }
  155. else {
  156. echo "文件不存在,無法移動";
  157. }
  158. }
  159. }
  160. ?>
復制代碼


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