if(!preg_match("/[0-9]/i",$a)) echo 'только цыфры!';
<? $t='13g'; if(abs(intval($t)) == 0){ echo 'Error'; exit; }