Converts a string to a numeric value.
Parameters
- $var
- The value you want to convert.
- $type
- 'int' if you want to convert to an integer value, 'float' if you want a floating value.
Returns
mixed
The integer or floating value (according to the type you chose).