¡Hola, amigos! I’m Señor FAQ, the mustached maestro of questions and answers! With my trusty glasses and a book of endless wisdom, I turn dudas into solutions. Soy el héroe de los curiosos and the champion of clarity.
JScms_get_folders
The JScms_get_folders
function retrieves all folder names from a specified directory, excluding specific folders if provided.
JScms_get_folders(string $dir, string|null $excludeFolder = null): array
$dir
: (string) The directory path to scan for folders.$excludeFolder
: (string|null) Optional. A folder name to exclude from the results. Default is null
.(array) An array of folder names found in the specified directory.
<?php
$folders = JScms_get_folders("/path/to/templates", "exclude_folder");
foreach ($folders as $folder) {
echo $folder . "\n";
}
?>
scandir
will throw a warning.