Cast string to either int or float
No, no function provides the automatic cast. However you can cast with this simple hack (the cast is automatically made by PHP in internal):
$int = "123"+0;$float = "1.23"+0;
for generic number:
$yourNumberCasted = $yourStringNumber + 0;
With a function:
function castToNumber($genericStringNumber) { return $genericStringNumber+0; }$yourNumberCasted = castToNumber($yourStringNumber);