I need to convert strings to intiger but with distinguish "foo"
from "0"
, because intval()
php function converts non numeric values to 0
.
With inputs:
$a = "10"
$b = "foo"
$c = "0"
$d = "10.5"
I expecting after convertion:
$a == 10
$b == "foo" // or false or whatever that is not an integer
$c == 0
$d == 10.5