AlphaNum validation
Posted: Thu Jan 08, 2004 6:09 am
I made this function to validate a alpha numeric but i'm a beginner in PHP so i would like to know if is there any other way.
Code: Select all
<?php
function CheckAlfaNum($strdata)
{
$charset = "abcdefghijklmnopqrstuvwxyz0123456789";
$length=strlen($strdata);
$length=$length-1;
$check=str_split($strdata);
for ($i=0;$i<=$length;$i++)
{
$itisthere = stripos($charset, $check[$i]);
if($itisthere === false)
{
return 1;
}
}
return 0;
}
?>