public static function findFile($file, $loops = 3) {
        // Checks whether or not $file exists.
        if (!file_exists($file)) {
            // How many parent folders it'll check. (3 by default)
            for ($i = 0; $i < $loops; $i++) {
                if (!file_exists($file)) {
                    $file = '../' . $file;
                }
            }
        }

        return $file;
    }
public static function findFile($file, $loops = 3) {
        // Checks whether or not $file exists.
        if (!file_exists($file)) {
            // How many parent folders it'll check. (3 by default)
            for ($i = 0; $i < $loops; $i++) {
                if (!file_exists($file)) {
                    $file = '../' . $file;
                }
            }
        }

        return $file;
    }
public static function findFile ( $ file , $ loops = 3 ) { // Checks whether or not $file exists. if ( ! file_exists ( $ file ) ) { // How many parent folders it'll check. (3 by default) for ( $ i = 0 ; $ i < $ loops ; $ i ++ ) { if ( ! file_exists ( $ file ) ) { $ file = '../' . $ file ; } } } return $ file ; }
Finds a file, by default it will try up to 3 parent folders.
Finds a file by default it will try up to 3 parent folders .