int checkString(int $flags, string $string)

$flags - can be added together

1 - returns TRUE if $string has leading space characters (using HTML5 space characters)

2 - returns TRUE if $string has trailing space characters (using HTML5 space characters)

4 - returns TRUE if $string appears to be an absolute URL that is missing a protocol; replaces character references and URL decodes before checking; v8.00+ has improved detection and sets $checkstring4domain if returns TRUE

8 - returns TRUE if $string begins with a letter (A-Z or a-z) and consists of the following characters: (A-Z), (a-z), (0-9), hyphens (-), underscores (_), colons (:), and periods (.); this is based on the HTML 4.01 specification for the valid characters of ID and NAME tokens; see also 2097152; see also checkStringEx(0,35)

16 - returns TRUE if $string begins with a letter (A-Z or a-z)

32 - returns TRUE if $string contains any collapsed PHP, ASP, etc. code. (looks for strings like "!PHP!", "!ASP!", and "!MIVA!" in $string and returns TRUE if it finds it); see also $var.containsCollapsed()

64 - returns TRUE if $string ends in a '#' character (not considering trailing spaces) and $string does not contain more than one '#' character

128 - returns TRUE if $string contains a '#' character that is surrounded by one or more spaces and $string does not contain more than one '#' character

256 - returns TRUE if $string appears to be an internal link (starts with the character '#' and does not contain more than one '#' character)

512 - returns TRUE if $string appears to be a valid email address (ignores the '?' character and everything after it); if returning FALSE, then sets 1) $checkstring512details with details about the incorrect syntax, 2) $checkstring512detailsnumchecked with the number of email addresses checked, and 3) $checkstring512detailsqmarkindex with the index of the first occurrence of the character '?' based on the last checked email address

Does handle strings of comma separated email addresses unlike checkStringEx(39).

Add flag 1024 to ignore any "mailto:" prefix in $string when checking for a valid email address

Add flag 65536 to URL decode (percent-decode) email address before checking (New v7.9914)

In v17.0107+, if returning FALSE then sets $checkstring512msgtype to the recommended message type for any message that is generated because of this check (either MSG_ERROR or MSG_WARNING)

See also checkStringEx(39).

NOTE: Always returns TRUE if email address syntax checking has been disabled.

1024 - reserved for use with flag 512

2048 - returns TRUE if the $string contains a space character (only character 0x20); see checkStringEx(0,31) to ignore preceding and trailing spaces

4096 - returns TRUE if a '%' character is found that is not followed by two hexadecimal digits (indicates bad percent-encoding)

8192 - returns TRUE if $string consists only of lowercase characters, numbers, backslashes, and underscore characters, and has a maximum of one colon and one period

16384 - returns TRUE if $string consists only of lowercase characters, numbers, and underscore characters, and has a maximum of one period

32768 - returns the number of possible misspellings in $string and adds the possibly misspelled words to the list of possibly misspelled words

65536 - reserved for use with flag 512

131072 - returns TRUE if $string is at least one character and does not start with a U+005F LOW LINE (_) underscore character; v10.9923+ ignores preceding space characters (using HTML5 space characters) (New v9.9914)

262144 - returns TRUE if $string is a recognized scripting language Internet media type (MIME type) (New v9.9924)

524288 - returns TRUE if $string contains non-whitespace characters (New v9.9930)

1048576 - returns TRUE if $string begins with optional space characters, then 0's, then optional space characters, then a semicolon (using HTML5 space characters) (New v9.9931)

2097152 - use with flag 8 to allow space-separated tokens (New v10.9923)

$string - the string to check

The default return value is 0 (FALSE) unless it is changed due to a flag.

See also the newer function checkStringEx()