php: check if string is valid md5 hash

Trabla: php: check if string is valid md5 hash

Solving:

function isValidMd5( $md5 ) { 

     return !empty($md5) && preg_match('/^[a-f0-9]{32}$/', $md5); 

}

No comments:

Post a Comment