Mecha CMS

Helper functions.

k

Filter g results by query.

2.0.0

k(string $folder, string $x, string $deep = 0, array $q, $content = false);
k(string $folder int $type, string $deep = 0, array $q, $content = false);

Example:

$q = ['foo', 'bar'];

// Search `foo` and `bar` in file name
foreach (k('.\path\to\folder', 1, 0, $q) as $path => $type) { … }
// Search `foo` and `bar` in file content as well
foreach (k('.\path\to\folder', 1, 0, $q, true) as $path => $type) { … }