Home > Backend Development > PHP Tutorial > 在服务器上的文件怎么重命名?

在服务器上的文件怎么重命名?

WBOY
Release: 2016-06-23 14:03:22
Original
1677 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);

$file_name='paypal logo.png';

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

rename($file_name,$file_new_name);

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