John Kaspar wrote:
Try taking the square root of the variable $sqrt = sqrt($var);
then compare the number of decimal places. if (strlen(strstr($sqrt,".")) <= strlen(strstr($var,"."))) { // perfect }
Just guessing of course.
I'd do something similar, but a little different:
$sqrt = sqrt($var);
if ($var == $sqrt * $sqrt) {
// perfect
}-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

