New Functions
PHP 5.3 introduced some new functions:
PHP Core:
Date/Time:
GMP:
Hash:
IMAP:
JSON:
MySQL Improved:
OpenSSL:
PCNTL:
PCRE:
-
preg_filter()
- Perform a regular expression search and replace, returning only results
which matched the pattern.
Semaphore:
The following functions are now natively implemented, making them available
on all operating systems which can run PHP:
New Functions
PHP 5.2.x introduced some new functions:
PHP Core:
Image:
libXML:
mbstring:
-
mb_stripos()
- Finds position of first occurrence of a string within another,
case insensitive
-
mb_stristr()
- Finds first occurrence of a string within another, case insensitive
-
mb_strrchr()
- Finds the last occurrence of a character in a string within another
-
mb_strrichr()
- Finds the last occurrence of a character in a string within another,
case insensitive
-
mb_strripos()
- Finds position of last occurrence of a string within another,
case insensitive
-
mb_strstr()
- Finds first occurrence of a string within another
ming (As of PHP 5.2.1):
-
void ming_setSWFCompression(int num)
- Sets output compression
-
void swfmovie::namedanchor(string name)
- Creates anchor
-
void swfmovie::protect([string password])
- Protects
openssl:
spl:
-
spl_object_hash()
- Return hash id for given object
-
int iterator_apply(Traversable it, mixed function [, mixed params])
- Calls a function for every element in an iterator
pcre:
pgsql:
-
pg_field_table()
- Returns the name of the table field belongs to, or table's oid
if
oid_only
is TRUE
posix:
gmp:
xmlwriter:
New Functions
In PHP 5 there are some new functions. Here is the list of them:
Arrays:
-
array_combine() - Creates an array by using one array
for keys and another for its values
-
array_diff_uassoc() - Computes the difference of
arrays with additional index check which is performed by a user supplied
callback function
-
array_udiff() - Computes the difference of arrays by
using a callback function for data comparison
-
array_udiff_assoc() - Computes the difference of
arrays with additional index check. The data is compared by using a
callback function
-
array_udiff_uassoc() - Computes the difference of
arrays with additional index check. The data is compared by using a
callback function. The index check is done by a callback function also
-
array_walk_recursive() - Apply a user function
recursively to every member of an array
-
array_uintersect_assoc() - Computes the intersection of
arrays with additional index check. The data is compared by using a
callback function
-
array_uintersect_uassoc() - Computes the intersection of
arrays with additional index check. Both the data and the indexes are compared
by using separate callback functions
-
array_uintersect() - Computes the intersection of arrays.
The data is compared by using a callback function
InterBase:
iconv:
Streams:
Date and time related:
Strings:
-
str_split() - Convert a string to an array
-
strpbrk() - Search a string for any of a set of
characters
-
substr_compare() - Binary safe optionally case
insensitive comparison of two strings from an offset, up to length
characters
Other:
Note:
The Tidy extension has also changed its
API completely.