if (strlen($cod_test) != 4 || preg_match("#^[0-9]+$#", $cod_test) )
if (preg_match("#^[0-9]{4}+$#", $cod_test) )