String functions
count
Counts the number of characters in a string
- Description
- Example
- Result
count(string)
count('Some Title')
10
date
An implementation of PHP's date()
- Description
- Example
- Result
date(format, [timestamp])
date('F j, Y, g:i a', 1062462400)
September 2, 2003, 12:26 am
escape
Performs an HTML escape of a string
- Description
- Example
- Result
escape(string)
escape('Hello <em>World</em>')
Hello <em>World</em>
floatval
An implementation of PHP's floatval()
- Description
- Example
- Result
floatval(value)
floatval('4.05')
4.05
includes
Determine if a string contains a given substring
Arguments:
needle
- the searched substringhaystack
- the string to search in.
- Description
- Example
- Result
includes(needle, haystack)
includes("Hello", "Hello World!")
true
intval
An implementation of PHP's intval()
- Description
- Example
- Result
intval(value, base = 10)
intval('4')
4
lower
Make a string lowercase
- Description
- Example
- Result
lower(string)
lower('Some Title')
some title
limit_characters
Limits string by characters
- Description
- Example
- Result
limit_characters(string, length, offset = 0)
limit_characters('Some String', 8)
Some Str
limit_words
Limits string by words
- Description
- Example
- Result
limit_words(string, words_count, offset = 0)
limit_words('Some super important text', 2)
Some super
match
Perform a regular expression match
Arguments:
pattern
- the pattern to search for, as a string.subject
- the input string.
- Description
- Example
- Result
match(pattern, subject)
match("/def$/", "abcdef")
true
number_format
An implementation of PHP's number_format()
- Description
- Example
- Result
number_format(number, decimals, decimal_separator, thousands_separator)
number_format(123456.8789, 2, ',', ' ')
123 456,88
sprintf
An implementation of PHP's sprintf()
- Description
- Example
- Result
sprintf(string, [...arguments])
sprintf('There are %d monkeys in the %s', 20, 'jungle')
There are 20 monkeys in the jungle
strtotime
An implementation of PHP's strtotime()
- Description
- Example
- Result
strtotime(string, [timestamp])
strtotime('last month', 1129633200)
strtotime('2009-05-04 08:30:00+00')
1127041200
1241425800
upper
Make a string uppercase
- Description
- Example
- Result
upper(string)
upper('Some Title')
SOME TITLE