snmp php compare integer code example Example 1: php string to int intval($string); Example 2: php float to int $int = intval($float);