- var_dump: documentation ( source)
- is_numeric: documentation ( source)
<?php
$tests = array(
'0x539',
'02471',
'1337e0',
'0b10100111001',
);
foreach ($tests as $element) {
var_dump((int)$element);
if (is_numeric($element)) {
echo "'{$element}' is numeric", PHP_EOL;
} else {
echo "'{$element}' is NOT numeric", PHP_EOL;
}
}