Strings
| Operator | Summary |
|---|---|
| append | Returns the input string with a custom sequence appended to it. |
| autolink | Returns the input string with the addresses replaced by link tags. |
| begins_with | Checks if a string starts with a specific character/sequence. |
| break | Returns the input string with all newlines converted to HTML breaks. |
| chr | Generates a string based on the input array of ASCII/UNICODE values. |
| compare | Compares the contents of two strings. |
| concat | Merges several strings into one string. |
| contains | Checks if a string contains a specific element. |
| count_chars | Returns the length of the input string. |
| count_words | Returns the number of words that make up the input string. |
| crc32 | Returns the CRC32 polynomial of the input string. |
| downcase | Returns a lowercased version of the input string. |
| ends_with | Checks if a string ends with a specific character/sequence. |
| explode | Splits the input string and returns it as an array of strings. |
| extract | Returns a portion of the input string. |
| extract_left | Returns a portion of the start of the input string. |
| extract_right | Returns a portion of the end of the input string. |
| indent | Returns an indented version of the input string. |
| insert | Returns the input string with additional text inserted at a specified position. |
| md5 | Returns the MD5 hash of the input string. |
| nl2br | Returns the input string with all newlines converted to HTML breaks. |
| ord | Returns an array containing the ASCII/UNICODE values of the input string. |
| pad | Returns a lengthened version of the input string. |
| prepend | Returns the input string prepended with a custom sequence. |
| remove | Returns a pruned version of the input string. |
| repeat | Returns a repeated version of the input string. |
| replace | Replaces elements in a string. |
| reverse | Returns a reversed version of the input string. |
| rot13 | Returns a ROT13 transformation of the input string. |
| shorten | Returns a shortened version of the input string. |
| simpletags | Returns a partially marked up version of the input string. |
| simplify | Returns a simplified version of the input string. |
| trim | Returns a stripped version of the input string. |
| upcase | Returns a capitalized version of the input string. |
| upfirst | Returns the input string with a capitalized initial letter. |
| upword | Returns the input string with capitalized initial letters. |
| wash | Returns an HTML-safe version of the input string. |
| wordtoimage | Returns the input string with embedded image tags. |
| wrap | Returns a wrapped version of the input string. |
Added for Exponential 6.0.15
| Name | Summary |
|---|---|
| addcslashes | addcslashes( string, charlist ) — charlist required |
| addslashes | PHP string function operators for Exponential templates. |
| bin2hex | PHP string function operators for Exponential templates. |
| chunk_split | chunk_split( string [, chunklen [, end]] ) |
| convert_uudecode | Suppress E_WARNING for malformed uuencoded input. |
| convert_uuencode | PHP string function operators for Exponential templates. |
| getenv | PHP getenv() |
| hebrev | hebrev( hebrew_text [, max_chars_per_line] ) |
| hex2bin | Returns false on invalid input; suppress PHP's E_WARNING for odd-length or non-hex strings so the template doesn't crash. |
| html_entity_decode | html_entity_decode( string [, flags [, encoding]] ) Defaults: ENT_QUOTES | ENT_HTML5, 'UTF-8' |
| htmlentities | htmlentities( string [, flags [, encoding [, double_encode]]] ) Defaults: ENT_QUOTES, 'UTF-8' |
| htmlspecialchars_decode | htmlspecialchars_decode( string [, flags] ) Default: ENT_QUOTES |
| lcfirst | PHP string function operators for Exponential templates. |
| levenshtein | levenshtein( str1, str2 ) — str2 required |
| ltrim | ltrim( string [, chars] ) |
| metaphone | metaphone( string [, max_phonemes] ) |
| number_format | number_format( number [, decimals [, dec_point, thousands_sep]] ) Note: PHP requires dec_point and thousands_sep to be given together. |
| quoted_printable_decode | PHP string function operators for Exponential templates. |
| quoted_printable_encode | PHP string function operators for Exponential templates. |
| quotemeta | PHP string function operators for Exponential templates. |
| rawurldecode | PHP rawurldecode() |
| rawurlencode | PHP rawurlencode() |
| ristring | str_replace( search, replace, subject ) — case-sensitive in-string replace Template: {$subject|ristring( "search", "replacement" )} Supports scalar and array search/replace patterns. |
| rstring | str_ireplace( search, replace, subject ) — case-insensitive in-string replace Template: {$subject|rstring( "Search", "replacement" )} Supports scalar and array search/replace patterns. |
| rtrim | rtrim( string [, chars] ) |
| serialize | PHP serialize() |
| similar_text | similar_text( str1, str2 ) — returns count of matching chars; str2 required |
| soundex | PHP string function operators for Exponential templates. |
| sprintf | sprintf( format, ...args ) — format is operatorValue, args are template params Uses vsprintf internally to accept a flat list of positional parameters. |
| str_contains | str_contains( haystack, needle ) — PHP 8.0+; fallback for older PHP |
| str_ends_with | str_ends_with( haystack, needle ) — PHP 8.0+; fallback for older PHP |
| str_getcsv | str_getcsv( string [, separator [, enclosure [, escape]]] ) PHP 8.4+ deprecates non-empty $escape; pass '' to opt-in to the RFC 4180-compliant behaviour and silence the deprecation notice. |
| str_shuffle | PHP string function operators for Exponential templates. |
| str_split | str_split( string [, length] ) |
| str_starts_with | str_starts_with( haystack, needle ) — PHP 8.0+; fallback for older PHP |
| str_word_count | str_word_count( string [, format [, charlist]] ) format 0 (default) = integer count; 1 = array of words; 2 = assoc array pos=>word |
| strcasecmp | strcasecmp( str1, str2 ) — case-insensitive comparison; str2 required |
| strcmp | strcmp( str1, str2 ) — binary-safe comparison; str2 required |
| strcoll | strcoll( str1, str2 ) — locale-based comparison; str2 required |
| strcspn | strcspn( str, mask [, offset [, length]] ) — mask required |
| strip_tags | strip_tags( string [, allowed_tags] ) |
| stripcslashes | PHP string function operators for Exponential templates. |
| stripos | stripos( haystack, needle [, offset] ) — case-insensitive strpos; needle required |
| stripslashes | PHP string function operators for Exponential templates. |
| stristr | stristr( haystack, needle [, before_needle] ) — case-insensitive strstr; needle required |
| strlen | Returns byte length. For character length use count_chars (uses mb_strlen). |
| strnatcasecmp | strnatcasecmp( str1, str2 ) — case-insensitive natural-order comparison; str2 required |
| strnatcmp | strnatcmp( str1, str2 ) — natural-order comparison; str2 required |
| strncasecmp | strncasecmp( str1, str2, n ) — compare first n chars, case-insensitive; str2 and n required |
| strncmp | strncmp( str1, str2, n ) — compare first n chars; str2 and n required |
| strpbrk | strpbrk( haystack, char_list ) — search for any char in char_list; char_list required |
| strpos | strpos( haystack, needle [, offset] ) — needle required |
| strrchr | strrchr( haystack, needle ) — last occurrence; needle required |
| strripos | strripos( haystack, needle [, offset] ) — case-insensitive strrpos; needle required |
| strrpos | strrpos( haystack, needle [, offset] ) — needle required |
| strspn | strspn( str, mask [, offset [, length]] ) — mask required |
| strstr | strstr( haystack, needle [, before_needle] ) — needle required |
| strtok | strtok( string, token ) — token required Note: PHP strtok is stateful. In a template this returns the first token only. Subsequent {strtok(token)} calls without a string will continue tokenizing. |
| strtr | strtr( string, from, to ) or strtr( string, replace_pairs_array ) |
| substr | substr( string, start [, length] ) — start required |
| substr_compare | substr_compare( main_str, str, offset [, length [, case_insensitive]] ) str and offset required |
| substr_count | substr_count( haystack, needle [, offset [, length]] ) — needle required |
| substr_replace | substr_replace( string, replace, start [, length] ) — replace and start required |
| unserialize | PHP unserialize() |
| urldecode | PHP urldecode() |
| urlencode | PHP urlencode() |
| vsprintf | vsprintf( format, args_array ) — format is operatorValue, args_array is params[0] |
In this section
- append Exponential Documentation
- autolink Exponential Documentation
- begins_with Exponential Documentation
- break Exponential Documentation
- chr Exponential Documentation
- compare Exponential Documentation
- concat Exponential Documentation
- contains Exponential Documentation
- count_chars Exponential Documentation
- count_words Exponential Documentation
- crc32 Exponential Documentation
- downcase Exponential Documentation
- ends_with Exponential Documentation
- explode Exponential Documentation
- extract Exponential Documentation
- extract_left Exponential Documentation
- extract_right Exponential Documentation
- indent Exponential Documentation
- insert Exponential Documentation
- md5 Exponential Documentation
- nl2br Exponential Documentation
- ord Exponential Documentation
- pad Exponential Documentation
- prepend Exponential Documentation
- remove Exponential Documentation
- repeat Exponential Documentation
- replace Exponential Documentation
- reverse Exponential Documentation
- rot13 Exponential Documentation
- shorten Exponential Documentation
- simpletags Exponential Documentation
- simplify Exponential Documentation
- trim Exponential Documentation
- upcase Exponential Documentation
- upfirst Exponential Documentation
- upword Exponential Documentation
- wash Exponential Documentation
- wordtoimage Exponential Documentation
- wrap Exponential Documentation
- addcslashes Available since Exponential 6.0.13. Summary addcslashes( string, charlist ) — charlist required Description PHP string function operators for Expone...
- addslashes Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- bin2hex Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- chunk_split Available since Exponential 6.0.13. Summary chunk_split( string [, chunklen [, end]] ) Description PHP string function operators for Exponential tem...
- convert_uudecode Available since Exponential 6.0.13. Summary Suppress E_WARNING for malformed uuencoded input. Description PHP string function operators for Exponent...
- convert_uuencode Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- getenv Provided by the extension bcgooglesitemaps (its settings/template.ini.append.php), not by the kernel. Summary Runs the PHP function getenv() on the inpu...
- hebrev Available since Exponential 6.0.13. Summary hebrev( hebrew_text [, max_chars_per_line] ) Description PHP string function operators for Exponential t...
- hex2bin Available since Exponential 6.0.13. Summary Returns false on invalid input; suppress PHP's E_WARNING for odd-length or non-hex strings so the template d...
- html_entity_decode Available since Exponential 6.0.13. Summary html_entity_decode( string [, flags [, encoding]] ) Defaults: ENT_QUOTES | ENT_HTML5, 'UTF-8' Description...
- htmlentities Available since Exponential 6.0.13. Summary htmlentities( string [, flags [, encoding [, double_encode]]] ) Defaults: ENT_QUOTES, 'UTF-8' Description...
- htmlspecialchars_decode Available since Exponential 6.0.13. Summary htmlspecialchars_decode( string [, flags] ) Default: ENT_QUOTES Description PHP string function operator...
- lcfirst Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- levenshtein Available since Exponential 6.0.13. Summary levenshtein( str1, str2 ) — str2 required Description PHP string function operators for Exponential temp...
- ltrim Available since Exponential 6.0.13. Summary ltrim( string [, chars] ) Description PHP string function operators for Exponential templates. Provides...
- metaphone Available since Exponential 6.0.13. Summary metaphone( string [, max_phonemes] ) Description PHP string function operators for Exponential templates...
- number_format Available since Exponential 6.0.13. Summary number_format( number [, decimals [, dec_point, thousands_sep]] ) Note: PHP requires dec_point and thousands...
- quoted_printable_decode Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- quoted_printable_encode Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- quotemeta Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- rawurldecode Available since Exponential 6.0.15 (in development, not in a release yet). Summary Runs the PHP function rawurldecode() on the input value (settings/tem...
- rawurlencode Available since Exponential 6.0.15 (in development, not in a release yet). Summary Runs the PHP function rawurlencode() on the input value (settings/tem...
- ristring Available since Exponential 6.0.13. Summary str_replace( search, replace, subject ) — case-sensitive in-string replace Template: {$subject|ristring( "se...
- rstring Available since Exponential 6.0.13. Summary str_ireplace( search, replace, subject ) — case-insensitive in-string replace Template: {$subject|rstring( "...
- rtrim Available since Exponential 6.0.13. Summary rtrim( string [, chars] ) Description PHP string function operators for Exponential templates. Provides...
- serialize Provided by the extension swark (its settings/template.ini.append.php), not by the kernel. Summary Runs the PHP function serialize() on the input value...
- similar_text Available since Exponential 6.0.13. Summary similar_text( str1, str2 ) — returns count of matching chars; str2 required Description PHP string funct...
- soundex Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- sprintf Available since Exponential 6.0.13. Summary sprintf( format, ...args ) — format is operatorValue, args are template params Uses vsprintf internally to a...
- str_contains Available since Exponential 6.0.13. Summary str_contains( haystack, needle ) — PHP 8.0+; fallback for older PHP Description PHP string function oper...
- str_ends_with Available since Exponential 6.0.13. Summary str_ends_with( haystack, needle ) — PHP 8.0+; fallback for older PHP Description PHP string function ope...
- str_getcsv Available since Exponential 6.0.13. Summary str_getcsv( string [, separator [, enclosure [, escape]]] ) PHP 8.4+ deprecates non-empty $escape; pass '' t...
- str_shuffle Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- str_split Available since Exponential 6.0.13. Summary str_split( string [, length] ) Description PHP string function operators for Exponential templates. Pro...
- str_starts_with Available since Exponential 6.0.13. Summary str_starts_with( haystack, needle ) — PHP 8.0+; fallback for older PHP Description PHP string function o...
- str_word_count Available since Exponential 6.0.13. Summary str_word_count( string [, format [, charlist]] ) format 0 (default) = integer count; 1 = array of words; 2 =...
- strcasecmp Available since Exponential 6.0.13. Summary strcasecmp( str1, str2 ) — case-insensitive comparison; str2 required Description PHP string function op...
- strcmp Available since Exponential 6.0.13. Summary strcmp( str1, str2 ) — binary-safe comparison; str2 required Description PHP string function operators f...
- strcoll Available since Exponential 6.0.13. Summary strcoll( str1, str2 ) — locale-based comparison; str2 required Description PHP string function operators...
- strcspn Available since Exponential 6.0.13. Summary strcspn( str, mask [, offset [, length]] ) — mask required Description PHP string function operators for...
- strip_tags Available since Exponential 6.0.13. Summary strip_tags( string [, allowed_tags] ) Description PHP string function operators for Exponential template...
- stripcslashes Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- stripos Available since Exponential 6.0.13. Summary stripos( haystack, needle [, offset] ) — case-insensitive strpos; needle required Description PHP string...
- stripslashes Available since Exponential 6.0.13. Summary PHP string function operators for Exponential templates. Description PHP string function operators for E...
- stristr Available since Exponential 6.0.13. Summary stristr( haystack, needle [, before_needle] ) — case-insensitive strstr; needle required Description PHP...
- strlen Available since Exponential 6.0.13. Summary Returns byte length. For character length use count_chars (uses mb_strlen). Description PHP string funct...
- strnatcasecmp Available since Exponential 6.0.13. Summary strnatcasecmp( str1, str2 ) — case-insensitive natural-order comparison; str2 required Description PHP s...
- strnatcmp Available since Exponential 6.0.13. Summary strnatcmp( str1, str2 ) — natural-order comparison; str2 required Description PHP string function operat...
- strncasecmp Available since Exponential 6.0.13. Summary strncasecmp( str1, str2, n ) — compare first n chars, case-insensitive; str2 and n required Description...
- strncmp Available since Exponential 6.0.13. Summary strncmp( str1, str2, n ) — compare first n chars; str2 and n required Description PHP string function op...
- strpbrk Available since Exponential 6.0.13. Summary strpbrk( haystack, char_list ) — search for any char in char_list; char_list required Description PHP st...
- strpos Available since Exponential 6.0.13. Summary strpos( haystack, needle [, offset] ) — needle required Description PHP string function operators for Ex...
- strrchr Available since Exponential 6.0.13. Summary strrchr( haystack, needle ) — last occurrence; needle required Description PHP string function operators...
- strripos Available since Exponential 6.0.13. Summary strripos( haystack, needle [, offset] ) — case-insensitive strrpos; needle required Description PHP stri...
- strrpos Available since Exponential 6.0.13. Summary strrpos( haystack, needle [, offset] ) — needle required Description PHP string function operators for E...
- strspn Available since Exponential 6.0.13. Summary strspn( str, mask [, offset [, length]] ) — mask required Description PHP string function operators for...
- strstr Available since Exponential 6.0.13. Summary strstr( haystack, needle [, before_needle] ) — needle required Description PHP string function operators...
- strtok Available since Exponential 6.0.13. Summary strtok( string, token ) — token required Note: PHP strtok is stateful. In a template this returns the first...
- strtr Available since Exponential 6.0.13. Summary strtr( string, from, to ) or strtr( string, replace_pairs_array ) Description PHP string function operat...
- substr Available since Exponential 6.0.13. Summary substr( string, start [, length] ) — start required Description PHP string function operators for Expone...
- substr_compare Available since Exponential 6.0.13. Summary substr_compare( main_str, str, offset [, length [, case_insensitive]] ) str and offset required Descripti...
- substr_count Available since Exponential 6.0.13. Summary substr_count( haystack, needle [, offset [, length]] ) — needle required Description PHP string function...
- substr_replace Available since Exponential 6.0.13. Summary substr_replace( string, replace, start [, length] ) — replace and start required Description PHP string...
- unserialize Provided by the extension swark (its settings/template.ini.append.php), not by the kernel. Summary Runs the PHP function unserialize() on the input valu...
- urldecode Available before Exponential 6: the 4.x kernel had it already; the 4.x reference had no page for it. Summary Runs the PHP function urldecode() on the in...
- urlencode Available before Exponential 6: the 4.x kernel had it already; the 4.x reference had no page for it. Summary Runs the PHP function urlencode() on the in...
- vsprintf Available since Exponential 6.0.13. Summary vsprintf( format, args_array ) — format is operatorValue, args_array is params[0] Description PHP string...
Contributors
- Balazs Halasy
- Graham Brookins Updated
Comments
Add a comment