1<?php 2 3if (!function_exists('ctype_digit')) 4{ 5 function ctype_digit($text) 6 { 7 if (is_string($text)) 8 { 9 if ('' === $text) 10 { 11 return false; 12 } 13 14 return !!preg_match('/^[\d]+$/', $text); 15 } 16 17 return false; 18 } 19} 20 21if (!function_exists('ctype_space')) 22{ 23 function ctype_space($text) 24 { 25 if ('' === $text) 26 { 27 return false; 28 } 29 30 return !!preg_match('/^[\s]+$/m', $text); 31 } 32} 33 34if (!function_exists('ctype_alnum')) 35{ 36 function ctype_alnum($sVar) 37 { 38 return !!preg_match('/^[a-zA-Z0-9]+$/', $sVar); 39 } 40}