1. Home
  2. Docs
  3. Packages
  4. Core package
  5. Functions

Functions

We have a collection of built-in functions you can use in the Editor in combination with expression language.
Some are built-in functions imported from the PHP language, while others were created specifically for use in Editor. You can learn how to use functions in our Expression language guide.

 

Name Origin Description Parameters
count PHP link 1 array or countable object, 2  optional COUNT_RECURSIVE
rand PHP link 1 lowest return number, 2 highest return number
strtolower PHP link 1 string
strtoupper PHP link 1 string
date PHP link 1 date format, 2 optional timestamp
is_numeric PHP link 1 variable
is_int PHP link 1 variable
strlen PHP link 1 string
array_rand PHP link 1 array, 2 number of entries to be picked
urlencode PHP link 1 string
str_replace PHP link 1 searched value, 2 replacement value, 3 array or string being searched, 4 optional number of replacements
array_splice PHP link 1 array, 2 offset number, 3 optional length number, 4 optional replacement array
is_array PHP link 1 variable
in_array PHP link 1 searched value, 2 array, 3 optional TRUE for strict search
array_search PHP link 1 searched value, 2 array, 3 optional TRUE for strict search
intval PHP link 1 mixed value, 2 base int
ceil PHP link 1 int or float num
floor PHP link 1 int or float num
array_values PHP link 1 array
array_column PHP link 1 array, 2 int or string or null column key, 3 optional int or string or null null for index key
array_merge PHP link 1 array one or more arrays
substr PHP link 1 string, 2 int, 3 optional int null for length
strpos PHP link 1 string haystack, 2 string needle, 3 optional int 0 for offset
strtotime PHP link 1 string datetime, 2 optional 0 for base timestamp
time PHP link none
explode PHP link 1 string separator, 2 string, 3 optional PHP_INT_MAX for limit
implode PHP link 1 string separator, 2 array
array_filter PHP link 1 array array, 2 optional callback function to use callback, 3 optional string mode
empty PHP link 1 mixed var
serialize PHP link 1 mixed value
unserialize PHP link 1 string data, 2 optional array options
json_last_error_msg PHP link
json_last_error PHP link
file_get_contents PHP link 1 string filename, 2 optional bool use_include_path
file_put_contents PHP link 1 string filename, 2 string data, 3 optional int flags
trim PHP link 1 string string, 2 optional string characters
filter_var PHP link 1 string value, 2 int filter, 3 array|int options
print_r custom Unlike original print_r, this one accepts single argument and will always return it’s value 1 mixed value
array_shuffle custom Randomizes the order of the elements an array 1 array
decode_special_chars custom Decodes special HTML characters 1 string
array_sort_by_field custom Sorts an array by field name 1 array, 2 name of the field
ordinal custom Converts a number to an ordinal number 1 numeric variable
human_concat custom Joins words together with a comma, and “and” 1 array
convo_val custom Returns value as an array while evaluating like an object like this: ${object} for arrays or object which contain objects as values. (DEPRECATED: no need for this function anymore) 1 array or \Zef\Zel\IValueAdapter
array_push custom Push one or more elements onto the end of array 1 array
json_encode custom Returns the JSON representation of a value 1 array
json_decode custom Decodes a JSON string 1 string
relative_date custom Returns the associative array of key value pairs. Those values represent if the given date is yesterday, today, tomorrow, last_week, this_week or next_week. 1 int or string date, 2 optional monday for start of week
date_tz custom Returns an date in an given format relative to an given timezone and base timestamp. 1 string date format, 2 optional int null for base timestamp, 3 optional string null for timezone
strtotime_tz custom Returns the timestamp relative to an given timezone string and base timestamp. 1 string datetime, 2 optional int null for base timestamp, 3 optional string null for timezone
parse_date_time custom Returns parsed date string from an platform slot value. 1 string date from platform slot, 2 optional string amazon for platform
parse_duration custom Returns parsed duration in seconds from an platform slot value. 1 string duration, 2 optional string amazon for platform, 3 optional int 30 for default duration in case the duration could not be computed from the string duration