Is there a PHP equivalent of Java's Character.getNumericValue(char c)
?
Use the intval()
function.
This will not handle letters or roman numerals the same way, but you could create your own method to do that for those cases. It will handle standard digits, though.
if (intval("2") === 2) echo("YAY!");
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