Home > Backend Development > PHP Tutorial > 请教用rename这个函数如何会出现这样的有关问题

请教用rename这个函数如何会出现这样的有关问题

WBOY
Release: 2016-06-13 13:24:23
Original
856 people have browsed it

请问用rename这个函数怎么会出现这样的问题?
Warning: rename(newpic (1).jpg,newpic (1)_LRG.jpg) [function.rename]: No such file or directory in F:\www1\16907_english\dao3\img.php on line 78
请问用rename这个函数怎么会出现这样的问题?


------解决方案--------------------
rename('newpic(1).jpg','newpic(1)_LRG.jpg');

我不确认你的文件名是否有空格,我给去掉了,另外请给两个名字都加上引号。

计算机是个很死板的东西,没有文件他不会提示你 php版本太低。
------解决方案--------------------
rename( $fn , $curDir );
这个 $fn 是不含路径的
要拼接上 $dirname 才行
rename( $dirname . '/' . $fn, ...

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