PHP code example of czproject / file-matcher

1. Go to this page and download the library: Download czproject/file-matcher library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

czproject / file-matcher example snippets

 php


use CzProject\FileMatcher\FileMatcher;

FileMatcher::matchMask($path, $masks[, $isPathDirectory]);

$masks = array(
	'temp/*',
	'.git*',
	'!.gitignore',
);

FileMatcher::matchMask('.git', $masks, TRUE); // returns TRUE
FileMatcher::matchMask('.gitignore', $masks); // return FALSE
FileMatcher::matchMask('temp/cache', $masks, TRUE); // returns TRUE
FileMatcher::matchMask('log/2016', $masks, TRUE); // returns FALSE