PHP functions
There are over 700 functions built into PHP. The following are seven that we used, with examples.
dirname
string dirname( string $path); Returns parent directory's path. Often this is used to determine the path to the current script.
Example:
print dirname(__FILE__); // prints something like '/users/me'
file_get_contents
string file_get_contents( string $filename [, bool $use_include_path = false [, resource $context [, int $offset = -1 [, int $maxlen ]]]] )Reads an entire file into a string. This is a useful way to read static, non-PHP files. It can even work for downloading remote files, but it's better to tie into the curl functions for serious downloading.
preg_match
int preg_match( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] )The preceding code performs a regular expression match using Perl-compatible regular expressions.
Example:
if ( preg_match('/^wp_/', $post_type) ){
print 'Post type cannot begin with wp_';
}Note
Special...