In PHP, you can use the rmdir() function to remove a directory, and the unlink() function to remove a file.