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

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

WBOY
WBOYOriginal
2016-06-23 14:03:221602browse

在 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);

Statement:
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
Previous article:检测按钮所在行Next article:php+smarty 不能播放flash