note 108746 modified in function.preg-match by danbrown
| From: | danbrown@php.net | Date: | Tue, 22 May 2012 19:45:32 +0000 |
| Subject: | note 108746 modified in function.preg-match by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-188138@lists.php.net to get a copy of this message | ||
Here's a regex to validate against the schema for common MySQL
identifiers: <?php $string =
"$table_name"; if
(preg_match("/[^\\d\\sa-zA-Z$_]/", $string)) echo "Failed
validation"; ?>
--was--
Here's a regex to validate against the schema for common MySQL
identifiers:
<?
$string = "$table_name";
if (preg_match("/[^\d\sa-zA-Z$_]/", $string))
echo "Failed validation";
?>
http://php.net/manual/en/function.preg-match.php