Home > Article > Backend Development > Simple usage of php to delete directory through rmdir, phprmdir directory usage_PHP tutorial
The example in this article describes the simple usage of php to delete the directory through rmdir. Share it with everyone for your reference. The specific analysis is as follows:
php can delete a directory on the server through the rmdir() function. The is_dir() function is used in the following code. This function is used to determine whether the specified string is a directory. If the deletion is successful, it returns True, otherwise it returns False
<?php if (!is_dir('exampledir')) { mkdir('exampledir'); } rmdir('exampledir'); ?>
I hope this article will be helpful to everyone’s PHP programming design.