convertString[Ex]() (tick_24Global)

string convertString(int $flags, string $string)

$flags - tells the function what to do to $string

1 - convert character references to actual characters (for example, convert " to ")

2 - extracts a link from a string in the format linkpage("link") or linkpage('link'); returns an empty string if no link can be extracted

4 - try to extract a charset from $string by returning what is found after "charset=" in $string; returns the extracted charset or an empty string if a charset could not be extracted

8 - replace multiple consecutive space characters in $string with a single space character; see also convertStringEx(6, ...)

16 - remove space characters in $string

32 - URL decode

65536 - remove preceding and trailing whitespace characters from $string; it is now recommended that trim() be used instead

If $flags specifies unknown flags or an error occurs, then the function may return $string unmodified. It will not generate an error.

string convertStringEx(int $mode, string $string)

$mode - tells the function what to do to $string

1 - remove all non-alpha characters including numbers and whitespace

2 - remove all non-alpha, non-digital characters including whitespace

3 - try to extract a file extension from $string and return it; else returns an empty string

4 - if possible, return a CSS equivalent string like ", like style=\"clear: both\"" based on $string which is the value of a "clear" attribute, else returns an empty string

5 - removes all characters (including the characters themselves) after any question mark or comma character

6 - replace multiple consecutive space characters in $string with a single space character and trim leading and trailing space characters; see also convertString(8, ...)

7 - convert the absolute or relative URL $string to a normalized absolute path if possible and return it; else return $string (Validator Engine Only; New v16.00)

8 - removes all characters (including the question mark) after any question mark character (New v21.03)

If $mode is unknown or an error occurs, then the function will, in most cases, return $string unmodified. It will not generate an error.