PHP analogues (PHP functions replacement) (tag)

is_iterable()

Polyfill for is_iterable() function added in PHP 7.1.

str_contains()

Performs a case-sensitive check indicating if needle is contained in haystack.

str_ends_with()

Performs a case-sensitive check indicating if the haystack ends with needle.

str_starts_with()

Performs a case-sensitive check indicating if the haystack begins with needle.

wp_basename()

i18n friendly version of basename()

wp_filesize()

Wrapper for PHP filesize with filters and casting the result as an integer.

wp_generate_uuid4()

Generates an identifier - a random unique string consisting of letters and numbers. Creates UUID (Universally unique identifier) version 4.

wp_json_encode()

Encode a variable into JSON, with some sanity checks. Checks strings and translates them to UTF-8.

wp_mkdir_p()

Recursive directory creation based on full path.

wp_parse_str()

Parses a string into variables to be stored in an array.

wp_rand()

Generates a random number between the specified min and max.

wp_sprintf()

WordPress implementation of PHP sprintf() with filters.