by shigemk2

当面は技術的なことしか書かない

is_numeric

こちらから。
PHP: is_numeric - Manual

変数が数値もしくは数字の文字列ならtrueを返す。
なので、変数の型は文字列でも構わない。

<?php
$tests = array(
    "42", 
    1337, 
    "1e4", 
    "not numeric", 
    array(), 
    9.1
);

foreach ($tests as $element) {
    if (is_numeric($element)) {
        echo "'{$element}' is numeric", PHP_EOL;
    } else {
        echo "'{$element}' is NOT numeric", PHP_EOL;
    }
}
?>

結果。

'42' is numeric
'1337' is numeric
'1e4' is numeric
'not numeric' is NOT numeric
'Array' is NOT numeric
'9.1' is numeric

上を見ても分かるように、数字の文字列でもtrueが返ってきてますね。