int checkString(int $flags, string $string)
•$flags - can be added together
•1 - returns TRUE if $string has leading space characters
•2 - returns TRUE if $string has ending space characters
•4 - returns TRUE if $string appears to be an absolute URL missing a protocol; v4.50 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; also see 2097152; also see 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) (New v4.0330)
•64 - returns TRUE if $string ends in a '#' character (not considering trailing spaces) and $string does not contain more than one '#' character (New v4.0410)
•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 (New v4.0410)
•256 - returns TRUE if $string appears to be an internal link (starts with the character '#' and does not contain more than one '#' character) (New v4.0410)
•512 - returns TRUE if $string appears to be a valid email address (ignores the '?' character and everything after it); as of v6.01, if returning FALSE, then sets 1) $checkstring512details with details about the incorrect syntax, 2) $checkstring512detailsnumchecked with the number of email addresses checked (new v6.50), and 3) $checkstring512detailsqmarkindex with the index of the first occurance of the character '?' based on the last checked email address (new v6.50); as of v6.01, works with multiple email addresses separated by commas. See also checkStringEx(39). NOTE: Always returns TRUE if email address syntax checking has been disabled. (New v4.05)
•1024 - use with flag 512; ignores any "mailto:" prefix in $string when checking for a valid email address (New v4.05)
•2048 - returns TRUE if the $string contains any space characters (New v4.5000)
•4096 - returns TRUE if a '%' character is found that is not followed by two hexadecimal digits (New v4.5000)
•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 (New v4.5021)
•16384 - returns TRUE if $string consists only of lowercase characters, numbers, and underscore characters, and has a maximum of one period (New v4.5022)
•32768 - returns the number of possible misspellings in $string and adds the possibly misspelled words to the list of possibly misspelled words (New v4.5091)
•65536 - use with flag 512; URL decode (percent-decode) email address before checking (New v7.9914)
•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 (New v9.9914)
•262144 - returns TRUE if $string is a recognized scripting language content type (New v9.9924)
•524288 - returns TRUE if $string contains non-whitespace characters (New v9.9930)
•1048576 - returns TRUE if $string begins with optional whitespace, then 0's then a semicolon (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.
int checkStringEx(int $flags, int $mode, string $string)
•$flags - can be added together; the $flags value depends on $mode so see the values for $mode below for available $flags; if a $mode does not say anything about $flags, then the $flags value is not used and should be 0.
•$mode - can not be added together
•1 - return TRUE if $string is a valid charset like "iso-8859-1"; also see mode 32
•2 - return TRUE if $string ends with a comma (disregarding trailing whitespace) (New v5.0200)
•3 - return TRUE if $string appears to be a valid "lang" attribute value; $flags below (New v5.4910)
•1 - set $checkstringex3append to a suggested message to append to any error message
•4 - return TRUE if $string begins with a '#' character (disregards preceding whitespace) (New v5.4910)
•5 - return TRUE if $string contains two or more adjacent hyphens (use for checking comments; excludes beginning "!--" and ending "--", returns FALSE if $string begins with "!--#"); if returns TRUE then use getLocation(7,0) to get location of hyphens (New v5.4910)
•6 - return TRUE if $string ends in "--" followed by one or more spaces (New v5.4910)
•7 - return the number of words in $string (New v5.4930)
•8 - return the number of repeated words/phrases given a comma separated list in $string; a list of repeated words/phrases is stored in $repeatedlist; the number of "empty" words is stored in $numemptywords (New v5.4940)
•9 - returns TRUE if $string is a percent (New v5.4940)
•10 - returns TRUE if $string contains only digits 0-9 (must contain at least one digit); $flags below (New v5.5100)
•1 - allow leading whitespace
•2 - allow trailing whitespace
•4 - allow an optional preceeding '-' character
•8 - require preceeding '-' character
•16 - allow zero or one '.' characters
•32 - require one '.' character
•64 - allow an optional ending '%' character
•128 - require ending '%' character
•256 - instead of returning TRUE or FALSE, return one of following values
•>=0 - value is OK
•<0 - value is NOT OK
•1 - value is a percent >100% (only if flag 512 set)
•-1 - miscellaneous reason why value is not OK
•-2 - misplaced or multiple '-' characters
•-3 - multiple '.' characters
•-4 - missing required '-' character
•-5 - missing required '.' character
•-6 - missing required '%' character
•-7 - contains unallowed character or bad format
•-8 - contains no digits (must contain at least 1)
•512 - use with flag 256 to allow a return value of 1
•11 - returns TRUE if $string contains only whitespace characters (one or more); also see 33 (New v5.9910)
•12 - returns TRUE if $string is an index page (such as "index.htm", "index.html", "index.php", "index.asp") or if $string ends in a "/" followed by an index page (New v5.9910)
•1 - if returning TRUE, then create variables $checkstringex12docname (contains "index.htm", "index.php", etc) and $checkstringex12recommendedurl (contains the recommended replacement URL)
•13 - returns TRUE if $string contains a semicolon and period but no comma between two '@' characters (used for checking mailto links with multiple email addresses that could incorrectly be separated with semicolons instead of commas) (New v6.4930)
•14 - returns TRUE if $string contains optional whitespace followed by optional digits (0-9) followed by optional whitespace followed by a CSS length unit; if returns TRUE, then the length unit is stored in $checkstringex14unit (New v6.4930)
•15 - returns TRUE if $string appears to contain mismatched double or single quotation marks (New v6.4940)
•1 - only check if value is <=100 characters
•16 - returns TRUE if $string appears to contain improper backslashes instead of forward slashes (use for checking links) (New v6.9921)
•17 - returns TRUE if $string appears to contain an improper double slash sequence (use for checking links) (New v6.9931)
•18 - returns the number of commas in $string (New v7.0000)
•19 - returns TRUE if $string is recognized as a web-safe typeface; if there are no recognized web-safe typefaces (if the list of recognized web-safe typefaces has been cleared), then will always return TRUE (New v8.00)
•20 - checks a comma separated list of typefaces in $string and returns FALSE if any of them are not recognized as "web-safe", which means that they may not be available on a significant number of browsers; else returns TRUE; if returns FALSE, then a list of the unrecognized typefaces is available in $checkstringex20list (with $checkstringex20listnum containing the number of typefaces in the list) and a complete list (including ignored typefaces) is available in $checkstringex20list2 (with $checkstringex20list2num containing the number of typefaces in the list).
In v8.9950 and above, if not all the typefaces are web-safe, then $checkstringex20unknownlist is also set with a list of unrecognized typeface names. $checkstringex20unknownlistnum contains the number of typefaces listed in $checkstringex20unknownlist.
In v10.0146 and above, if not all the typefaces are web-safe, then $checkstringex20numwebsafe is also set with the number of recognized web-safe typeface names, not including the generic font family keywords (like serif, sans-serif, monospace, etc.).
In v10.9912 and above, $checkstringex20extrainfo is also set with extra information about the listed typefaces, if it is available (if not available then it is empty).
NOTE: Once a typeface is recognized as not being web-safe and the number of recognized web-safe typefaces is 0, the typeface is ignored in further calls to this function for the duration of the validation. This is to prevent the same typeface (when used multiple times) from generating more than one validator message. You can add to the recognized list of web-safe typefaces using setValueString(10,typeface name) in the onConfigLoad() function. $flags below
•1 - do not consider ignored typefaces from previous calls when returning TRUE or FALSE
•2 - do not use; this flag used internally
•21 - checks a comma separated list of typefaces in $string and returns FALSE if there are any unrecognized typefaces or if typefaces from more than one family were specified. If returns FALSE, then sets $checkstringex21msg with the text of a message to display, $checkstringex21numunrec with the number of unrecognized typefaces, $checkstringex21msgtype with the recommended message type (regular message if there were no unrecognized typefaces or a warning message type if there were unrecognized typefaces), and (in v9.0192 and later) $checkstringex21msgid with a recommended message ID. NOTE: Once a typeface is not recognized, it is ignored in further calls to this function for the duration of the validation. This is to prevent the same typeface being used multiple times from generating more than one validator message about it. You can add to the recognized list of typefaces using setValueString(11,typeface name) in the onConfigLoad() function. $flags below
•2 - do not use; this flag used internally
•22 - returns TRUE if $string contains a Sitestepper variable and Sitestepper integration is both on and supported in the edition being used (supported in std/pro editions) (New 8.0200)
•23 - returns TRUE if $string appears to be a link that can be passed to the link checker (preceding space characters are ignored) (New 8.9910)
•24 - returns TRUE if $string is a recognized typeface name (New 8.9950)
•25 - checks a comma separated list of typefaces in $string and returns FALSE if there is a possible issue with CLF 2.0 compliance. If returns FALSE, then sets $checkstringex25msg with the text of a message to display, $checkstringex25numunrec with the number of possibly incompliant typefaces, $checkstringex25msgtype with the recommended message type, and $checkstringex25msgid with a recommended message ID. NOTE: Once a typeface is not recognized, it is ignored in further calls to this function for the duration of the validation. This is to prevent the same typeface being used multiple times from generating more than one validator message about it. You can add to the recognized list of typefaces using setValueString(11,typeface name) in the onConfigLoad() function. $flags below
•2 - do not use; this flag used internally
•26 - returns an int representing the color in $string; works with colornames and colors in the format #RRGGBB; ignores preceding space characters; returns -1 if fails (New 9.9910)
•27 - returns an int based on the value of $string; for use with "input" elements to represent the value of the "type" attribute as an integer (set $string to the value of the "type" attribute); case-insensitive; runs program 65 (with flag 1) if it's an HTML5 control value and the program is running in an attribute or attribute value program (New v9.9914)
•set flag 1 to NOT run program 65 (New v9.9927)
•return values: 0-(unknown), 1-image, 2-file, 3-textarea, 4-text (default), 5-checkbox, 6-radio, 7-password, 8-hidden, 9-submit, 10-reset, 11-button, HTML5: 12-search, 13-tel, 14-url, 15-email, 16-datetime, 17-date, 18-month, 19-week, 20-time, 21-datetime-local, 22-number, 23-range, 24-color
•28 - returns TRUE if the CSS property $string was used in the value of the "style" attribute else returns FALSE; always returns FALSE if style checking is not enabled; forces style checking of the "style" attribute if style checking is enabled (New v9.9927)
•29 - returns TRUE if $string contains only recognized values for the "rel" attribute of the "link" element (separated by whitespace; case-insensitive); else returns FALSE and sets $checkstringex29badlist with a quoted list of the unrecognized values, $checkstringex29badlistnum with the number of unrecognized values, and (in v10.9944+) $checkstringex29badmsgappend with a suggested string to append to any error message (New v9.9933)
•30 - returns TRUE if $string contains at least one U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) character (New v10.9921)
•31 - returns TRUE if $string contains any space characters, not considering any preceding and trailing space characters (New v10.9923)
•32 - like 1, but also returns true if $string contains any collapsed PHP, ASP, etc. code (New v10.9923)
•33 - returns TRUE if $string is empty or contains only whitespace characters; also see 11 (New v10.9923)
•34 - returns an int based on the value of $string; for use with WAI-ARIA "role" attributes to represent the value of the attribute as an integer (set $string to the value of the "role" attribute); case-insensitive (New v10.9926)
•return values: 0-(unknown), 1-alert, 2-alertdialog, 3-application, 4-article, 5-banner, 6-button, 7-checkbox, 8-columnheader, 9-combobox, 10-complementary, 11-contentinfo, 12-definition, 13-dialog, 14-directory, 15-document, 16-form, 17-grid, 18-gridcell, 19-group, 20-heading, 21-img, 22-link, 23-list, 24-listbox, 25-listitem, 26-log, 27-main, 28-marquee, 29-math, 30-menu, 31-menubar, 32-menuitem, 33-menuitemcheckbox, 34-menuitemradio, 35-navigation, 36-note, 37-option, 38-presentation, 39-progressbar, 40-radio, 41-radiogroup, 42-region, 43-row, 44-rowgroup, 45-rowheader, 46-search, 47-separator, 48-scrollbar, 49-slider, 50-spinbutton, 51-status, 52-tab, 53-tablist, 54-tabpanel, 55-textbox, 56-timer, 57-toolbar, 58-tooltip, 59-tree, 60-treegrid, 61-treeitem
•35 - returns TRUE if $string is a valid HTML5 ID token (at least one character and no space characters); also see checkString(8) (New v11.0043)
•36 - 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 (-), and underscores (_); this is based on the HTML 4.01 specification for the valid characters of ID and NAME tokens but excludes the possibly problematic period (.) and colon (:) characters (New v11.0043)
•37 - returns TRUE if $string is a valid value for a "link" element's "sizes" attribute, else returns FALSE and sets $checkstringex37badlist (New v11.0114)
•38 - returns TRUE if $string appears to use the document.write() or document.writeln() function (New v11.9915)
•39 - returns TRUE if $string appears to be a valid email address; if returning FALSE, then sets 1) $checkstringex39details with details about the incorrect syntax. See also checkString(512). NOTE: Always returns TRUE if email address syntax checking has been disabled. (New v11.9942)
•$string - the string to check
•The default return value is 0 (FALSE) unless it is changed due to a valid mode.