PHP rename file on same host

前端 未结 3 1730
忘掉有多难
忘掉有多难 2021-01-26 15:00
$url = \'http://site.com/images/name.jpg\';

Its a full path for the file, which is already exists on ftp.

How can I change file\'s name

3条回答
  •  不要未来只要你来
    2021-01-26 15:35

    As others already point out, the PHP function you're looking for is rename, but you can't rename a file through a http:// URL (At least not in PHP - As @Artefacto says, WebDAV can do this.).

    You will need to specify a proper filesystem path.

提交回复
热议问题