Php - GLOB_ONLYDIR function, List all the base directories in linux os

GLOB_ONLYDIR function


<?php
$directories = glob($somePath . '/*' , GLOB_ONLYDIR);
print_r($directories);
?>
OUTPUT:
Array ( [0] => /bin [1] => /boot [2] => /cgroup [3] => /dev [4] => /etc .... ) 

The above is a sample output. The above code is used to print the directories using php code.

The topic on Php - GLOB_ONLYDIR function is posted by - Maha

Hope you have enjoyed, Php - GLOB_ONLYDIR functionThanks for your time

Tech Bluff