bool2sql (line
424)
Converts boolean value to integer for use in SQL queries.
int
bool2sql
(bool $value)
-
bool
$value: Boolean value.
date_floor (line
591)
Round specified timestamp down to midnight.
int
date_floor
(int $timestamp)
date_offset (line
605)
Returns timestamp, shifted from specified for particular number of days.
Negative offset shifts to past, positive - to future.
int
date_offset
(int $timestamp, int $offset)
get_http_auth_realm (line
636)
Generates Basic HTTP Authentication realm, based on client browser.
string
get_http_auth_realm
()
is_email (line
486)
Finds whether the given UTF-8 encoded string contains valid email address.
bool
is_email
(string $str)
-
string
$str: The UTF-8 encoded string being evaluated.
is_intvalue (line
461)
Finds whether the given UTF-8 encoded string contains valid integer value.
bool
is_intvalue
(string $str)
-
string
$str: The UTF-8 encoded string being evaluated.
is_username (line
474)
Finds whether the given UTF-8 encoded string contains valid login (only latin characters, digits, and underline are allowed).
bool
is_username
(string $str)
-
string
$str: The UTF-8 encoded string being evaluated.
sendmail (line
510)
Sends email notification.
bool
sendmail
(string $sender, string $from, string $to, string $subject, string $message, [int $attachment_id = NULL], [string $attachment_name = NULL], [string $attachment_type = NULL], [int $attachment_size = NULL])
-
string
$sender: Name of sender.
-
string
$from: Email address of sender.
-
string
$to: Email addresses of recipients (comma-separated).
-
string
$subject: Subject of the notification.
-
string
$message: Body of the notification.
-
int
$attachment_id: ID of attachment if it should be included in email, NULL otherwise.
-
string
$attachment_name: Name of attachment if it should be included in email, NULL otherwise.
-
string
$attachment_type: MIME type of attachment if it should be included in email, NULL otherwise.
-
int
$attachment_size: Size of attachment if it should be included in email, NULL otherwise.
swap (line
448)
Exchanges values of two variables.
void
swap
(mixed &$value1, mixed &$value2)
-
mixed
&$value1: First variable.
-
mixed
&$value2: Second variable.
time2ustr (line
317)
Converts specified amount of minutes to its string representation in format "hh:mm".
string
time2ustr
(int $time)
-
int
$time: Amount of minutes.
try_request (line
436)
Returns value of user HTML-form request, if it exists; otherwise returns specified default value.
mixed
try_request
(string $request, [mixed $value = NULL])
-
string
$request: Name of user HTML-form request.
-
mixed
$value: Default value.
ustr2csv (line
374)
Convert UTF-8 encoded string to CSV format.
string
ustr2csv
(string $str, [string $delimiter = ','], [string $enclosure = '"'])
-
string
$str: The UTF-8 encoded string.
-
string
$delimiter: CSV delimiter.
-
string
$enclosure: CSV enclosure.
ustr2html (line
328)
Strips HTML-tags from UTF-8 encoded string.
string
ustr2html
(string $str)
-
string
$str: The UTF-8 encoded string.
ustr2int (line
295)
Converts UTF-8 encoded string to integer (natural) value.
If resulted integer value is less then specified min value, the min value will be returned. If resulted integer value is greater then specified max value, the max value will be returned.
int
ustr2int
(string $str, [int $min = 0], [int $max = MAXINT])
-
string
$str: The UTF-8 encoded string being converted.
-
int
$min: Minimum allowed result value.
-
int
$max: Maximum allowed result value.
ustr2js (line
342)
Strips quotes from UTF-8 encoded string.
string
ustr2js
(string $str)
-
string
$str: The UTF-8 encoded string.
ustr2sql (line
353)
Strips apostrophes from UTF-8 encoded string.
string
ustr2sql
(string $str)
-
string
$str: The UTF-8 encoded string.
ustrcut (line
244)
Trims UTF-8 encoded string and then cuts it to specified length.
string
ustrcut
(string $str, int $maxlen)
-
string
$str: The UTF-8 encoded string being cut.
-
int
$maxlen: New length of the string (amount of UTF-8 characters).
ustripos (line
153)
Unicode (UTF-8) analogue of standard stripos PHP function.
Find position of first occurrence of a case-insensitive UTF-8 encoded string. Returns the numeric position (offset in amount of UTF-8 characters) of the first occurrence of needle in the haystack string.
int
ustripos
(string $haystack, string $needle, [int $offset = 0])
-
string
$haystack: The UTF-8 encoded string being searched in.
-
string
$needle: The UTF-8 encoded string being searched for.
-
int
$offset: The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
ustrlen (line
119)
Unicode (UTF-8) analogue of standard strlen PHP function.
Returns the length of the given string.
int
ustrlen
(string $str)
-
string
$str: The UTF-8 encoded string being measured for length.
ustrpos (line
136)
Unicode (UTF-8) analogue of standard strpos PHP function.
Find position of first occurrence of a case-sensitive UTF-8 encoded string. Returns the numeric position (offset in amount of UTF-8 characters) of the first occurrence of needle in the haystack string.
int
ustrpos
(string $haystack, string $needle, [int $offset = 0])
-
string
$haystack: The UTF-8 encoded string being searched in.
-
string
$needle: The UTF-8 encoded string being searched for.
-
int
$offset: The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
ustrprocess (line
272)
The function accepts variable number of arguments and replaces each "%i" (where i is a natural number) substring of input string with related argument.
Passed arguments can be any type of; in case of string they should be UTF-8 encoded.
string
ustrprocess
(string $str, mixed 1, mixed 2, mixed 3)
-
string
$str: The UTF-8 encoded string being processed.
-
mixed
1: Value, which each "%1" substring will be replaced with.
-
mixed
2: Value, which each "%2" substring will be replaced with.
-
mixed
3: ... (and so on)
ustrrpos (line
171)
Unicode (UTF-8) analogue of standard strrpos PHP function.
Find position of last occurrence of a case-sensitive UTF-8 encoded string. Returns the numeric position (offset in amount of UTF-8 characters) of the last occurrence of needle in the haystack string.
int
ustrrpos
(string $haystack, string $needle)
-
string
$haystack: The UTF-8 encoded string being searched in.
-
string
$needle: The UTF-8 encoded string being searched for.
ustrtolower (line
184)
Unicode (UTF-8) analogue of standard strtolower PHP function.
Make a string lowercase.
string
ustrtolower
(string $str)
-
string
$str: The UTF-8 encoded string to be lowercased.
ustr_getcsv (line
396)
Parse UTF-8 encoded CSV string into an array.
array
ustr_getcsv
(string $str, [string $delimiter = ','], [string $enclosure = '"'])
-
string
$str: The UTF-8 encoded CSV string.
-
string
$delimiter: CSV delimiter.
-
string
$enclosure: CSV enclosure.
ustr_replace (line
216)
Unicode (UTF-8) analogue of standard str_replace PHP function.
Replace all occurrences of the search string with the replacement string.
string
ustr_replace
(string $search, string $replace, string $subject)
-
string
$search: The UTF-8 encoded string being searched for.
-
string
$replace: The UTF-8 encoded string being replaced with.
-
string
$subject: The UTF-8 encoded string being searched in.
usubstr (line
201)
Unicode (UTF-8) analogue of standard substr PHP function.
Returns the portion of string specified by the start and length parameters.
string
usubstr
(string $str, int $start, [int $length = NULL])
-
string
$str: The UTF-8 encoded string.
-
int
$start: Start of portion to be returned. Position is counted in amount of UTF-8 characters from the beginning of str. First character's position is 0. Second character position is 1, and so on.
-
int
$length: If length is given, the string returned will contain at most length characters beginning from start (depending on the length of string). If length is omitted, the rest of string from start will be returned.