How can I use the rmdir function to remove a directory in PHP? Example code: - Biz Tech

How can I use the rmdir function to remove a directory in PHP? Example code:

Listen
$directory = "/path/to/directory";

rmdir($directory);