Skip to main content

PHPFunctions

Short description

The following PHP functions can also be used in the CMS syntax. Their usage corresponds to that directly in PHP.

Global Template Functions

  • array_key_exists — Checks if a key exists in the array.

  • arsort — Sorts an array in reverse order while maintaining the index association.

  • asort — Sorts an array while maintaining the index association.

  • bin2hex — Returns an ASCII string that contains the parameter’s hexadecimal output.

  • ceil — Returns the next integer that is greater than or equal to the parameter.

  • count — Counts all elements in an array or attributes in an object.

  • curl_close — Ends a cURL session.

  • curl_exec — Runs a cURL session.

  • curl_init — Starts a cURL session.

  • curl_setopt — Sets an option for a cURL transfer.

  • current — Returns the current element in an array.

  • date — Formats a specified local time / date.

  • explode — Splits a string by string to create an array.

  • floor — Returns the next integer that is less than or equal to the parameter.

  • htmlentities — Converts all suitable characters to HTML codes.

  • implode — Combines array elements to a string.

  • in_array — Checks if a value exists in an array.

  • is_array — Checks if the variable is an array.

  • is_numeric — Checks if a variable is a number or a numeric string.

  • is_string — Checks if the variable is of the type String.

  • json_decode — Decodes a JSON character string. The result can be saved to a local template variable.

  • json_encode — Returns the JSON representation of a value.

  • krsort — Sorts an array by keys in reverse order.

  • ksort — Sorts an array by keys.

  • md5 — Calculate a string’s MD5 hash.

  • natcasesort — Sorts an array by natural order ignoring case.

  • natsort — Sorts an array by natural order.

  • nl2br — Inserts HTML line wraps before all line wraps of a string.

  • number_format — Formats a number with grouped thousands.

  • print — Returns the contained value as HTML. Permitted values are a template variable or a string.

  • round — Rounds the first parameter to the number of decimal places specified in the second parameter.

  • rsort — Sorts an array in reverse order.

  • simplexml_load_string — Converts a string to a simpleXML object and returns this object.

  • sort — Sorts an array.

  • str_replace — Replaces all occurrences of a search string by a different string.

  • strip_tags — Removes HTML tags from a string.

  • stripos — Finds the first occurrence of a string ignoring case.

  • strlen — Detects the string length.

  • strpos — Finds the search string’s first occurrence.

  • strtolower — Makes a string lowercase.

  • strtotime — Parses any English date format into a Unix timestamp.

  • strtoupper — Makes all characters of a string uppercase.

  • substr — Returns part of a string.

  • trim — Strips whitespace or other characters from the beginning and end of a string.

Global Template Variables

  • $ENT_COMPAT — Constant: Only converts double quotation marks. Single quotation marks are not converted and remain unchanged.

  • $ENT_QUOTES — Constant: Converts both double and single quotation marks.

To top