Is there any way to list *.css from directories/subdirectories recursively? I want to make a css selector... The following script lists nonrecursively... But i need a recursive list...
themeselect.php :
<?php
if (ini_get('display_errors')) {
ini_set('display_errors', 1);
}
date_default_timezone_set('UTC');
if ($_POST['currentcss']){
setcookie('currentcss', $_POST['currentcss']);
}
require_once('getcss.php');
function right($value, $count){
return substr($value, ($count*-1));
}
function left($string, $count){
return substr($string, 0, $count);
}
echo '<select name="currentcss" id="currentcss">';
foreach (glob(getcwd() . '/*.css') as $filename) {
$filename = right($filename, (strlen($filename) - strlen(getcwd()) - 1));
echo '<option value="' . $filename . '">' . $filename . '</option>';
}
echo '</select>';
?>
getcss.php :
<?php
function getcss(){
if (file_exists($_COOKIE["currentcss"])) {
echo ('<LINK href="' . $_COOKIE["currentcss"] . '" rel="stylesheet" type="text/css">');
}
else{
echo ('<LINK href="default.css" rel="stylesheet" type="text/css">');
}
}
?>