Previous Page
locale()

Solar_Filter_SanitizeInt
sanitizeInt()

Next Class
Solar_Filter_SanitizeIpv4

sanitizeInt()

public int 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.