Это то, что у меня есть:
Код: Выделить всё
if (isset($_GET['mac'])) {
if (strlen($_GET['mac']) == 18) {
$get_mac_filtered = preg_replace('/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/', '',$_GET['mac']);
if (preg_match('/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/', $_GET['mac']) == $get_mac_filtered) {
echo 'Got a mac match! '.$get_mac_filtered;
}else {
echo 'Sorry !=';
}
} else {
die();
}
}
Подробнее здесь: https://stackoverflow.com/questions/358 ... eck-format
Мобильная версия