Hi when trying to cast from a string to int using int() I get the following error:
Call to undefined function int()
Why would this be?
intval() works just fine but I cannot use int() for some reason.
There is no int function; you must use proper typecasting syntax for this:
$b = (int) $a;
Or:
settype($a, 'int');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With