PHP hernoemen() Functie
❮ Referentie voor PHP-bestandssysteemVoorbeeld
Hernoem een map + een bestand:
<?php
rename("images","pictures");
rename("/test/file1.txt","/home/docs/my_file.txt");
?>
Definitie en gebruik
De functie rename() hernoemt een bestand of map.
Syntaxis
rename(old, new, context)
Parameterwaarden
Parameter | Description |
---|---|
old | Required. Specifies the file or directory to be renamed |
new | Required. Specifies the new name for the file or directory |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
Technische details
Winstwaarde: | WAAR bij succes, ONWAAR bij mislukking |
---|---|
PHP-versie: | 4.0+ |
PHP-wijzigingslogboek: | PHP 5.3.1: Sta het hernoemen van bestanden op verschillende stations in Windows toe. PHP 5.0: kan worden gebruikt met sommige URL-wrappers. |
❮ Referentie voor PHP-bestandssysteem