Less than 1 minute
str_fixtype
Fix a numeric string.
public str_fixtype({Array})
Sometimes a numeric (int or float) will be stored as a string variable. This can cause issues with functions that check the variable type to determine what to do with it. This function allows you to simply pass a variable through it and it will 'fix' it. If it is a string and is a numeric value, it will be converted to the appropriate variable type.
If the value is a string and is meant to be a string, it will be left alone.
Parameters
Parameter | Type | Description |
---|---|---|
$value | mixed | the variable to type check and possibly fix |
Generated by Hazaar API Doc Generator