function mp3player_validate_hex in MP3 Player 6.2
Same name and namespace in other branches
- 7.2 mp3player.module \mp3player_validate_hex()
Various tests to hex values.
Parameters
$value:
Return value
bool|null|string
1 call to mp3player_validate_hex()
- mp3player_player_form_validate in ./
mp3player.module - form_validate.
File
- ./
mp3player.module, line 524 - mp3player main module file.
Code
function mp3player_validate_hex($value) {
if (strlen($value) != 6) {
return t('HEX code must be 6 characters long.');
}
if (preg_match('/[^0-9a-fA-F]/', $value)) {
return t('Invalid HEX code submitted');
}
return FALSE;
}