3
validatedbname
validate_db_name
SYNOPSIS
validate_db_name($s)
DESCRIPTION
validate_db_name
returns true
if $s
is a valid database name, false
otherwise.
CODE
- function validate_db_name($s) {
- $regexp='/^[a-zA-Z][a-zA-Z0-9_]{1,64}$/';
- return preg_match($regexp, $s);
- }
Comments