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.

Php - List all the base directories in linux os
The topic on Php - GLOB_ONLYDIR function is posted by - Maha
Hope you have enjoyed, Php - GLOB_ONLYDIR function . Thanks for your time.

All rights reserved. © www.w3calculator.com