Skip to main content

String functions

count

Counts the number of characters in a string

count(string)

date

An implementation of PHP's date()

date(format, [timestamp])

escape

Performs an HTML escape of a string

escape(string)

floatval

An implementation of PHP's floatval()

floatval(value)

includes

Determine if a string contains a given substring

Arguments:

  • needle - the searched substring
  • haystack - the string to search in.
includes(needle, haystack)

intval

An implementation of PHP's intval()

intval(value, base = 10)

lower

Make a string lowercase

lower(string)

limit_characters

Limits string by characters

limit_characters(string, length, offset = 0)

limit_words

Limits string by words

limit_words(string, words_count, offset = 0)

match

Perform a regular expression match

Arguments:

  • pattern - the pattern to search for, as a string.
  • subject - the input string.
match(pattern, subject)

number_format

An implementation of PHP's number_format()

number_format(number, decimals, decimal_separator, thousands_separator)

sprintf

An implementation of PHP's sprintf()

sprintf(string, [...arguments])

strtotime

An implementation of PHP's strtotime()

strtotime(string, [timestamp])

upper

Make a string uppercase

upper(string)