method checkPath documentation in bbn\Str

Checks if every bit of a string doesn't contain a filesystem path.

Example

X::dump(\bbn\Str::checkFilename("Paul")); // (bool) true X::dump(\bbn\Str::checkFilename("Paul/")); // (bool) false function() { if ($args = \func_get_args()) { foreach ($args as $a){ if (!is_string($a) || strpos($a, '/', -1) !== false || strpos($a, '\\', -1) !== false ) { return false; } $bits = X::split($a, DIRECTORY_SEPARATOR); foreach ($bits as $b){ if (!self::checkFilename($b)) { return false; } } } return true; } return false; }

Checks if every bit of a string doesn't contain a filesystem path. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.