I'm trying to use gettype to check people passwords, ie disallow ones without a couple of letters/couple of numbers in the end.
However for some reason I've hit a big problem...
$foo = "3.14";
print gettype ($foo); //gives string
$foo = '3.14';
print gettype ($foo); //gives string
$foo = 3.14;
print gettype ($foo); //gives integer
The method I'm trying to use to grab it out of the password is just
$alpha = 0;
$beta = 0;
for ($i=0; $i<=$length; $i++) {
if ((gettype ($split[$i])) == "string") {$alpha = "1";}
elseif ((gettype ($split[$i])) == "integer") {$beta = "1";}
}
echo "alpha: $alpha";
echo "beta: $beta";
Whatever I put in for the password, alpha is 1, beta is 0, even if I put in 46546574 :-(
I'm sure its due to the '' / "" problem, I just can't figure out how to fix it.