- pathinfo: documentation ( source)
- strpos: documentation ( source)
- dirname: documentation ( source)
- explode: documentation ( source)
<?php
foreach ( new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . "/usr") ) as $filename ) {
$path_parts = pathinfo ( $filename );
if (strpos ( $path_parts ['basename'], ".class.php" ) !== FALSE) {
$fullpath = $path_parts ['dirname'] . "\\" . $path_parts ['basename'];
$class_parts = explode ( ".class.php", $path_parts ['basename'] );
if (count ( $class_parts ) != 0) {
include_once $fullpath;
}
}
}