Home > Backend Development > PHP Tutorial > 在服务器下的文件如何重命名

在服务器下的文件如何重命名

WBOY
Release: 2016-06-13 12:51:19
Original
1467 people have browsed it

在服务器上的文件怎么重命名?
在 public_html/login/paypal logo.png 文件

现在的要求是写段程序把

paypal logo.png ――》  paypal-logo.png 

怎么做?


------解决方案--------------------
rename('paypal logo.png', 'paypal-logo.png');

------解决方案--------------------
$file_name='paypal logo.png';

$file_new_name=str_replace(' ','_',$file_name);

rename($file_name,$file_new_name);
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template