- var_dump: documentation ( source)
- preg_match: documentation ( source)
- pack: documentation ( source)
<?php
$legit_id = pack("c3", ord('5'), 0, -34);
var_dump($legit_id);
var_dump(check_input_data($legit_id, 'int'));
function check_input_data($data, $type)
{
//if (preg_match('/^[0-9]{1,10}$/D', $data) && $data < 2147483647)
if (preg_match('/^[\w]{1,30}$/D', $data))
return true;
return false;
}