Solar_Filter_SanitizeInt::sanitizeInt()

public int Solar_Filter_SanitizeInt::sanitizeInt ( mixed $value )

Forces the value to an integer.

Parameters

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

Returns

  • (int) The sanitized value.

Description

Forces the value to an integer.

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



Local