PHP function to convert a string to an integer value. code example Example 1: php string to int intval($string); Example 2: php str to int intval("15");