Skip to content
Advertisement

Tag: integer

strange question about PHP convert string to int

im trying to convert string to integer but return 0 or wrong number. Below is the code i have tested. Anyone know why? Thanks return integer 85 0 0 Answer By default, intval() parses base 10, so it ignores the 0x prefix. If you specify the base as 0, it will determine the base dynamically from the string prefix: 0x

Advertisement