- is_numeric: documentation ( source)
<?php
foreach(array("1") as $strTest)
{
if (is_numeric($strTest))
{
if ($strTest > 1)
{
echo "$strTest is greater than 1!\n";
}
else
{
echo "$strTest is less than or equal to 1!\n";
}
}
}