note 40251 added to function.md5
| From: | mina86 at tlen dot pl | Date: | Thu, 26 Feb 2004 16:14:58 +0000 |
| Subject: | note 40251 added to function.md5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65805@lists.php.net to get a copy of this message | ||
In respons to Emin Sadykhov at 14-Oct-2003 12:47:
The function presented by Emin isn't IMO simple, simpler is:
<?php
if (!function_exists('is_md5')) {
function is_md5($var) {
return preg_match('/^[A-Fa-f0-9]{32}$/',$var);
}
}
?>
Morover (as I proved somewhere else) it's faster 'cuz preg_match() is faster then ereg()
----
Manual Page -- http://www.php.net/manual/en/function.md5.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40251
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40251&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40251&report=yes
Search -- http://master.php.net/manage/user-notes.php