Utility class providing common functions
| package |
Framework |
|---|---|
| subpackage |
Utils |
anytodatetime(string $date, \DateTimeZone $timezone = null) : \DateTime
stringDate string
\DateTimeZoneTimezone to use for DateTime object
\DateTimeinstance or false on failure
bin2ascii(string $input) : string
stringBinary input
stringReadable output
check_email(string $email, boolean $dns_check = true) : boolean
stringEmail address
booleanTrue to check dns
booleanTrue on success, False if address is invalid
check_ip(string $ip) : boolean
stringIP address in v4 or v6 format
booleanTrue if the address is valid
check_referer() : boolean
booleanTrue if referer is the same host+path, false if not
clean_datestr(string $date) : string
stringDate string
stringDate string
date_format(string $format = null) : string
This method supports microseconds (u).
stringDate format (default: 'd-M-Y H:i:s O')
stringFormatted date
explode_quoted_string( $delimiter, $string) : array
arrayString items
file2class(string $mimetype, string $filename) : string
stringMimetype
stringFilename
stringCSS classes separated by space
format_datestr(string $date, string $format) : \strin
Supported formats: 'Y/m/d', 'Y.m.d', 'd-m-Y', 'd/m/Y', 'd.m.Y', 'j.n.Y'
stringDate string
stringInput date format
\strinDate string in YYYY-MM-DD format, or the original string if format is not supported
get_boolean(string $str) : boolean
stringInput value
booleanBoolean value
get_input_value( $fname, $source, $allow_html = false, $charset = null) : string
stringField value or NULL if not available
get_opt(array $aliases = array()) : array
arrayArgument alias names
arrayArgument values hash
html_identifier( $str, $encode = false)
https_check(integer $port = null, boolean $use_https = true) : boolean
integerHTTPS port number
booleanEnables 'use_https' option checking
boolean
idn_convert( $input, $is_utf = false)
idn_to_ascii( $str)
idn_to_utf8( $str)
is_absolute_path( $path)
max_upload_size() : integer
integerMaximum size in bytes
mem_check( $need) : boolean
booleanTrue if memory won't be exceeded, False otherwise
mod_css_styles( $source, $container_id, $allow_remote = false) : string
stringModified CSS source
normalize_string( $str, $as_array = false, $minlen = 2) : mixed
Currently only optimized for ISO-8859-1 and ISO-8859-2 characters; to be extended
mixedNormalized string or a list of normalized tokens
parse_host(string $name, string $host = '') : string
stringHostname
stringOptional IMAP hostname
stringHostname
parse_input_value( $value, $allow_html = false, $charset = null) : string
stringParsed value
prompt_silent( $prompt = "Password:") : string
stringPassword
random_bytes(integer $length, boolean $raw = false) : string
integerString length
booleanReturn RAW data instead of ascii
stringThe generated random string
remote_addr() : string
stringRemote IP address
remote_ip() : string
stringRemote IP address(es)
rep_specialchars_output( $str, $enctype = '', $mode = '', $newlines = true) : string
stringThe quoted string
request2param(integer $mode = null, string $ignore = 'task|action', boolean $allow_html = false) : array
integerSource to get value from (GPC)
stringPCRE expression to skip parameters by name
booleanAllow HTML tags in field value
arrayHash array with all request parameters
request_header(string $name) : mixed
stringHeader name
mixedHeader value or null if not available
resolve_url(string $url) : string
stringRelative URL
stringAbsolute URL
strtotime(string $date, \DateTimeZone $timezone = null) : integer
stringDate string
\DateTimeZoneTimezone to use for DateTime object
integerUnix timestamp
tokenize_string( $str, $minlen = 2) : array
arrayList of tokens
words_match( $haystack, $needle) : boolean
booleanTrue if match, False otherwise
xss_entity_decode( $content) : string
stringDecoded string
xss_entity_decode_callback(array $matches) : string
arrayResult from preg_replace_callback
stringDecoded entity
INPUT_GET
INPUT_POST
INPUT_GPC