method checkName documentation in bbn\Str

Checks if a string complies with SQL naming convention.

Example

X::dump(\bbn\Str::checkName("Paul")); // (bool) true X::dump(\bbn\Str::checkName("Pa ul")); // (bool) false function() { $args = \func_get_args(); // Each argument must be a string made of letters, numbers and underscores foreach ($args as $a) { if (\is_array($a)) { foreach ($a as $b) { if (!self::checkName($b)) { return false; } } } if (!\is_string($a)) { return false; } return \preg_match('/^[A-z0-9_]*$/', $a); } return true; }

Checks if a string complies with SQL naming convention. 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.