您的位置 首页 php

php copy函数的使用详解(代码示例)

PHP中的copy()函数是一个内置函数,用于复制指定的文件。它将源文件复制到目标文件,如果目标文件已经存在,它将被覆盖。copy()函数在成功时返回true,失败时返回false。

语法:

bool copy ( $source, $dest )

参数:

PHP中的copy()函数接受两个参数,即源参数和目标参数。

$source:它指定源文件的路径。

$dest:用于指定目标文件的路径。

返回值:

成功时返回true,失败时返回false。

错误和异常:

PHP中的copy()函数不适用于远程文件。它只对服务器文件系统可访问的文件起作用。

如果目标文件已经存在,它将被覆盖。

copy()函数代码使用示例1:

<?php   // 复制gfg.txt到php.txt echo copy("gfg.txt", "php.txt");   ?>

输出:

true

copy()函数代码使用示例2:

<?php   $srcfile = '/user01/Desktop/admin/gfg.txt'; $destfile = 'user01/Desktop/admin/php.txt';   if (!copy($srcfile, $destfilefile)) {     echo "文件不能被复制 \n"; } else {     echo "文件已被复制!"; }   ?>

输出:

文件已被复制!

相关推荐:《PHP教程》

以上就是php copy函数的使用详解(代码示例)的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:php copy函数的使用详解(代码示例)

文章地址:https://www.zhihuclub.com/5481.shtml

关于作者: 智云科技

热门文章

评论已关闭

40条评论

  1. This hopeless aspiration was easily frustrated by Martin Bormann, Hitler s secretary and party chancellor

  2. MRI confirmed the presence of an undescended ovary at the right pelvic brim, anterior to the psoas muscle, containing several follicles Figure 4.

  3. 23 The NCCN recommends tamoxifen over raloxifene for most postmenopausal women desiring non surgical risk reduction therapy because it is more effective com 20 E2 AD 90 20What 20Does 20Viagra 20Do 20 20How 20To 20Get 20Rid 20Of 20Viagra 20Side 20Effects what does viagra do In the heart of the town of Jackson, and close to restaurants, boutiques, art galleries and nightlife, this hotel has a large indoor heated pool and dry sauna

  4. Eur J Cancer Clin Oncol 24 785 790, 1988 Here, we investigated the molecular basis of thiopurine resistance by exploring the whole genome basal transcriptomic profiles involved in 6 MP resistant and sensitive phenotypes of LCLs originating from unrelated healthy individuals and selected by in vitro growth inhibition assays

  5. Radiology and Medical Imaging Department, College of Applied Medical Sciences, Salman bin Abdulaziz University, Al Kharj Saudi Arabia All together, these properties imply that the catalytic pocket is situated in a locked hole

  6. After 8 months of therapy, the patient remains in good clinical condition, continues to receive olaparib, and will be followed up with regular tumor marker assessment and PET CT

  7. 7 investigated the role of miRNAs in tamoxifen resistance in breast cancer where differentially expressed miRNA signatures representing tamoxifen resistant TamR and sensitive cell lines were identified

  8. EPO is a safe medication with similar efficacy for pain control in women with mastalgia compared to a placebo, topical NSAIDS, danazol, or vitamin E

  9. levitra antibiotica flucloxacilline The elevated levels of attempted suicide among gang members could be linked to psychiatric illness, say the authors, but they also suggest it could be linked to the idea that impulsive violence can be directed at oneself as well as others

  10. As a result of the implementation of the policy of a state which is stable, self confident and invests in modern technologies, the Law and Justice s conservative government has a plan today to act even faster and more efficiently in the sphere of innovations But the Muslim Brotherhood has urged its supporters to dig in their heels, and warns that any violence could ignite the whole of Egypt

  11. Those precious momments make it all worth it Other symptoms are facial tenderness and swelling, nasal congestion, stuffy nose, earache, and jaw pain

  12. Blood samples for PK analysis were obtained from patients who had good compliance with taking medications 2 4 h after taking anti estrogens x 1 Paclitaxel 300 mg

  13. Avoid use of NSAIDs, including Nabumetone, in pregnant women at about 30 weeks gestation and later

  14. I was getting infusions of Zometa every month Importantly, no S100ОІ tdT cells were observed in the intimal EC or medial SMC layers of these sham vessels following tamoxifen treatment Figure 3d

  15. This type of therapy does not target cancer cells directly, but stimulates the immune system in a general way to improve the immune response

  16. In conclusion, levels of bowel morbidity are significantly higher in patients being treated with opioids in Hospice Africa Uganda

  17. I don t know what this old man was beaten to death, and he almost didn side effects of my blood pressure medication t want his larostan medication high blood pressure life, what would he do to grab this thing

  18. Patients that have a section of malformed ureter causing obstruction at the UPJ usually will not make it to adulthood without either being treated already or without severe damage over the years making salvaging the kidney impossible

  19. A blood test for progesterone a hormone produced after ovulation can also document that you re ovulating

  20. Following the quality assessment using the SIGN checklist, all studies contributing data to the quantitative analyses were found to be of high or acceptable quality, with an adequate method of allocation concealment full quality appraisal available in the Additional file 1 Table 6 5 near the osteoporosis threshold T score of 2

  21. Now, she is locked in the dungeon under the temple, She said how long does fatigue last after starting ramipril As he spoke, do apple cider vinegar pills lower blood pressure his eyes turned red do apple cider vinegar pills lower blood pressure proteins in urine blood pressure pills involuntarily, The five guardian samurai who followed Physician together have always been the best of close friends, with a deep affection that cannot 102 78 blood pressure medicine be compared with others

  22. Ototoxicity is one of the main preventable causes of deafness and an outcome that can perhaps be most directly influenced by healthcare professionals Mudd 2016

  23. 2002; 346 1054 9 It sounds like there s something going wrong with your period coming way too soon or something weird

  24. In vivo three photon 3P imaging Antibiotics Tetracycline antibiotics interacts with RIBOFLAVIN

网站地图