PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
elo are there any good functions to aid in validation
like in C i use isalpha() and in java i can use isLetter()
i have my variable as a string but how can i turn this into an array to deal with character validation just some good pointers required as i know the theory just not the good functions to use
on this note any good places to find out this info, some reference or summit like java docs gives me.
function isLengthWithinRange($input_string, $max_length, $min_length){
$sof = count($input_string);
if($sof>$max_length || $sof < $min_length){
echo "size out of bounds<br>";
echo $sof;
return FALSE;
}
else{
return TRUE;
}
}
as you can see im trying to validate range (sof) seems to always be 1 i thought the count() function returned the number of elements in the input_string variable.
what am i doing wrong?
also a little explaining as to hoe this conversion is achieved although this is probs the answer hehe.
You still might be interested in checking out the manual. I suggest checking out empty() php.net/empty and is_string() php.net/is_string They are both good for validation purposes.