Solar_Filter_SanitizeFloat::sanitizeFloat()

public float Solar_Filter_SanitizeFloat::sanitizeFloat ( mixed $value )

Forces the value to a float.

Parameters

  • (mixed) $value: The value to be sanitized.

Returns

  • (float) The sanitized value.

Description

Forces the value to a float.

Attempts to extract a valid float from the given value, using an algorithm somewhat less naive that "remove all characters that are not '0-9.,eE+-'". The result may not be expected, but it will be a float.



Local