Looking for a Tutor Near You?

Post Learning Requirement »
x

Choose Country Code

x

Direction

x

Ask a Question

x

x
x
x
Hire a Tutor

PhP

Loading...

Published in: PHP And MySQL
5,263 Views

This note is for PhP learners. In this note PhP Array is covered.

Bikram K / Delhi

6 years of teaching experience

Qualification: MCA

Teaches: Data Structures, DBMS & RDBMS, Oracle Training, PL/SQL, Computer, IT, C / C++, Java And J2EE, Visual Basic

Contact this Tutor
  1. PHP Array Introduction The array functions allow you to manipulate arrays. PHP supports both simple and multi-dimensional arrays. There are also specific functions for populating arrays from database queries. Installation The array functions are part of the PHP core. There is no installation needed to use these functions. PHP Array Functions PHP: indicates the earliest version of PHP that supports the function. Function array() array array a r ray array array array array array array array array array array array a r ray array array change key chunk() combine() case() count values() diff() diff assoc() diff key() diff uassoc() diff ukey() fill() filter() flip() intersect() intersect intersect intersect intersect assoc() key ( ) uassoc() ukey() Description Creates an array Returns an array with all keys in lowercase or uppercase Splits an array into chunks of arrays Creates an array by using one array for keys and another for its values Returns an array with the number of occurrences for each value Compares array values, and returns the differences Compares array keys and values, and returns the differences Compares array keys, and returns the differences Compares array keys and values, with an additional user- made function check, and returns the differences Compares array keys, with an additional user-made function check, and returns the differences Fills an array with values Filters elements of an array using a user-made function Exchanges all keys with their associated values in an array Compares array values, and returns the matches Compares array keys and values, and returns the matches Compares array keys, and returns the matches Compares array keys and values, with an additional user- made function check, and returns the matches Compares array keys, with an additional user-made function check, and returns the matches PHP 3 4 4 5 4 4 4 5 5 5 4 4 4 4 4 5 5 5
  2. array a rra array array a rra array array array array array array array array array array array array a rra array array array array array array a r ray array array array array key exists() map() merge() mer e recursive multisort() pad() pop() product() push() rand() reduce() search() shift() slice() splice() sum udiff() udiff assoc() udiff uassoc() uintersect() uintersect assoc() uintersect uassoc() uniaue() unshift() values() walk() walk recursive() arsort() asort() compact() Checks if the specified key exists in the array Returns all the keys of an array Sends each value of an array to a user-made function, which returns new values Merges one or more arrays into one array Merges one or more arrays into one array Sorts multiple or multi-dimensional arrays Inserts a specified number of items, with a specified value, to an array Deletes the last element of an array Calculates the product of the values in an array Inserts one or more elements to the end of an array Returns one or more random keys from an array Returns an array as a string, using a user-defined function Returns an array in the reverse order Searches an array for a given value and returns the key Removes the first element from an array, and returns the value of the removed element Returns selected parts of an array Removes and replaces specified elements of an array Returns the sum of the values in an array Compares array values in a user-made function and returns an array Compares array keys, and compares array values in a user- made function, and returns an array Compares array keys and array values in user-made functions, and returns an array Compares array values in a user-made function and returns an array Compares array keys, and compares array values in a user- made function, and returns an array Compares array keys and array values in user-made functions, and returns an array Removes duplicate values from an array Adds one or more elements to the beginning of an array Returns all the values of an array Applies a user function to every member of an array Applies a user function recursively to every member of an array Sorts an array in reverse order and maintain index association Sorts an array and maintain index association Create array containing variables and their values 4 4 4 4 4 4 4 4 5 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 4 4 4 3 5 3 3 4
  3. count() current each() end() extract() in array() krsort() ksort() list() natcasesort() natsort() next() pos() rev range() reset() rsort() shuffle() sizeof() sort() uasort() uksort() usort() SORT DESC Counts elements in an array, or properties in an object Returns the current element in an array Returns the current key and value pair from an array Sets the internal pointer of an array to its last element Imports variables into the current symbol table from an array Checks if a specified value exists in an array Fetches a key from an array Sorts an array by key in reverse order Sorts an array by key Assigns variables as if they were an array Sorts an array using a case insensitive "natural order" algorithm Sorts an array using a "natural order" algorithm Advance the internal array pointer of an array Alias of current() Rewinds the internal array pointer Creates an array containing a range of elements Sets the internal pointer of an array to its first element Sorts an array in reverse order Shuffles an array Alias of count() Sorts an array Sorts an array with a user-defined function and maintain index association Sorts an array by keys using a user-defined function Sorts an array by values using a user-defined function PHP Array Constants PHP: indicates the earliest version of PHP that supports the constant. 3 3 3 3 3 4 3 3 3 3 4 4 3 3 3 3 3 3 3 3 3 3 3 3 PHP Constant CASE LOWER CASE UPPER SORT ASC SORT REGULAR Description Used with array_change_key_case() to convert array keys to lower case Used with array_change_key_case() to convert array keys to upper case Used with array_multisort() to sort in ascending order Used with array multisort() to sort in descending order Used to compare items normally
  4. SORT NUMERIC SORT STRING SORT LOCALE STRING COUNT NORMAL COUNT RECURSIVE EXTR OVERWRITE EXTR SKIP PREFIX SAME EXTR EXTR PREFIX ALL EXTR PREFIX INVALID EXTR PREFIX IF EXISTS EXTR IF EXISTS EXTR REFS Used to compare items numerically Used to compare items as strings Used to compare items as strings, based on the current locale PHP Calendar Introduction The calendar functions are useful when working with different calendar formats. The standard it is based on is the Julian day count (Julian day count is a count of days starting from January 1, 4713 B.C.). Note that the Julian day count is not the same as the Julian calendar! Note: To convert between calendar formats, you must first convert to Julian day count, then to the calendar format. Installation The windows version of PHP has built-in support for the calendar extension. So, the calendar functions will work automatically. However, if you are running the Linux version of PHP, you will have to compile PHP with - enable-calendar to get the calendar functions to work. PHP Calendar Functions PHP: indicates the earliest version of PHP that supports the function. Function cal cal cal days in month() from jd() info() Description Returns the number of days in a month for a specified year and calendar Converts a Julian day count into a date of a specified calendar Returns information about a given calendar 4 PHP 4 4 4
  5. cal to jd() easter date easter days() FrenchToJD() GregorianToJD() JDDayOfWeek() JDMonthName() JDToFrench JDToGregorian() jdtojewish() JDToJulian() jdtounix() JewishToJD() JulianToJD() unixto•d MONTH JEWISH Converts a date to Julian day count Returns the Unix timestamp for midnight on Easter of a specified yea r Returns the number of days after March 21, on which Easter falls for a specified year Converts a French Republican date to a Julian day count Converts a Gregorian date to a Julian day count Returns the day of a week Returns a month name Converts a Julian day count to a French Republican date Converts a Julian day count to a Gregorian date Converts a Julian day count to a Jewish date Converts a Julian day count to a Julian date Converts a Julian day count to a Unix timestamp Converts a Jewish date to a Julian day count Converts a Julian date to a Julian day count Converts a Unix timestamp to a Julian day count PHP Calendar Constants PHP: indicates the earliest version of PHP that supports the constant. Constant CAL GREGORIAN CAL JULIAN CAL JEWISH FRENCH NUM CALS DOW DAYNO DOW SHORT DOW LONG Description Gregorian calendar Julian calendar Jewish calendar French Republican calendar CAL CAL CAL CAL CAL CAL CAL CAL CAL CAL CAL CAL CAL MONTH GREGORIAN SHORT MONTH GREGORIAN LONG MONTH JULIAN SHORT MONTH JULIAN LONG MONTH FRENCH EASTER DEFAULT EASTER ROMAN 4 3 3 3 3 3 3 3 3 3 3 4 3 3 4 PHP 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4
  6. CAL CAL CAL JEWISH CAL JEWISH CAL JEWISH PHP Date / Time Introduction The date/time functions allow you to extract and format the date and time on the server. Note: These functions depend on the locale settings of the server! Installation The date/time functions are part of the PHP core. There is no installation needed to use these functions. Runtime Configuration The behavior of the date/time functions is affected by settings in php.ini. Date/Time configuration options: EASTER ALWAYS GREGORIAN EASTER ALWAYS JULIAN ADD ALAFIM GERESH ADD ALAFIM ADD GERESHAYIM 4 4 5 5 5 Name date.default latitude Default "31.7667" date.default_longitude "35.2333" date.sunrise zenith date.sunset zenith date.timezone "90.83" "90.83" Description Specifies the default latitude (available since PHP 5). This option is used by date_sunrise() and date_sunset() Specifies the default longitude (available since PHP 5). This option is used by date_sunrise() and date_sunset() Specifies the default sunrise zenith (available since PHP 5). This option is used by date_sunrise() and date_sunset() Specifies the default sunset zenith (available since PHP 5). This option is used by date_sunrise() and date_sunset() Specifies the default timezone (available since PHP 5.1) Changeable PI-IP INI ALL PI-IP INI ALL PHP INI ALL PHP INI ALL PHP INI ALL PHP Date / Time Functions
  7. Function checkdate date default timezone date default timezone date sunrise() date sunset() date() getdate() gettimeofday() gmdate() gmmktime() mstrftime idate() localtime() microtime mktime() strftime() strptime() strtotime() time() PHP: indicates the earliest version of PHP that supports the function. DATE ATOM DATE RSS get() Description Validates a Gregorian date Returns the default time zone Sets the default time zone Returns the time of sunrise for a given day / location Returns the time of sunset for a given day / location Formats a local time/date Returns an array that contains date and time information for a Unix timestamp Returns an array that contains current time information Formats a GMT/UTC date/time Returns the Unix timestamp for a GMT date Formats a GMT/UTC time/date according to locale settings Formats a local time/date as integer Returns an array that contains the time components of a Unix timestamp Returns the microseconds for the current time Returns the Unix timestamp for a date Formats a local time/date according to locale settings Parses a time/date generated with strftime() Parses an English textual date or time into a Unix timestamp Returns the current time as a Unix timestamp PI-IP Date / Time Constants PHP: indicates the earliest version of PHP that supports the constant. PHP 3 5 5 5 5 3 3 3 3 3 3 5 4 3 3 3 5 3 3 PHP Constant DATE COOKIE DATE IS08601 RFC822 DATE RFC850 DATE RFC1036 DATE RFC1123 DATE RFC2822 DATE Description Atom (example: I-ITTP Cookies (example: sun, 14 Aug 2005 UTC) ISO-8601 (example: RFC 822 (example: sun, 14 Aug 2005 UTC) RFC 850 (example: Sunday, 14-Aug-05 UTC) RFC 1036 (example: Sunday, 14-Aug-05 UTC) RFC 1123 (example: sun, 14 Aug 2005 UTC) RFC 2822 (Sun, 14 Aug 2005 +0000) RSS (Sun, 14 Aug 2005 UTC)
  8. DATE W3C World Wide Web Consortium (example: 2005-08- PHP Directory Introduction The directory functions allow you to retrieve information about directories and their contents. Installation The directory functions are part of the PHP core. There is no installation needed to use these functions. PHP Directory Functions PHP: indicates the earliest version of PHP that supports the function. Function chdjrC) chroot() dir() closedir() getcwd() opendir() readdir() rewinddir() scandir(). Description Changes the current directory Changes the root directory of the current process Opens a directory handle and returns an object Closes a directory handle Returns the current directory Opens a directory handle Returns an entry from a directory handle Resets a directory handle Lists files and directories inside a specified path PHP Directory Constants PHP: indicates the earliest version of PHP that supports the constant. Constant DIRECTORY SEPARATOR PATH SEPARATOR Description PHP 3 4 3 3 4 3 3 3 5 PHP 3 4 PHP Error and Logging Introduction The error and logging functions allows error handling and logging.
  9. The error functions allow users to define error handling rules, and modify the way the errors can be logged. The logging functions allow users to log applications and send log messages to email, system logs or other machines. Installation The error and logging functions are part of the PHP core. There is no installation needed to use these functions. PHP Error and Logging Functions PHP: indicates the earliest version of PHP that supports the function. Function debug backtrace() debug print backtrace() error get last() error log() error reporting() restore error handler() restore exception handler() set error handler() set exception handler() trigger error() user error() Description Generates a backtrace Prints a backtrace Gets the last error occurred Sends an error to the server error-log, to a file or to a remote destination Specifies which errors are reported Restores the previous error handler Restores the previous exception handler Sets a user-defined function to handle errors Sets a user-defined function to handle exceptions Creates a user-defined error message Alias of trigger_error() PHP Error and Logging Constants PHP: indicates the earliest version of PHP that supports the constant. Value Constant PHP 4 5 5 4 4 4 5 4 5 4 4 PHP 1 2 4 E E E ERROR WARNING PARSE Description Fatal run-time errors. Errors that cannot be recovered from. Execution of the script is halted Non-fatal run-time errors. Execution of the script is not halted Compile-time parse errors. Parse errors should only be generated by the parser
  10. 8 16 32 64 128 256 512 1024 2048 4096 6143 NOTICE E E CORE ERROR E CORE WARNING E COMPILE ERROR E COMPILE WARNING USER ERROR E USER WARNING E USER NOTICE E STRICT E RECOVERABLE ERROR E E ALL Run-time notices. The script found something that might be an error, but could also happen when running a script normally Fatal errors at PHP startup. This is like an E _ ERROR in 4 the PHP core Non-fatal errors at PHP startup. This is like an E WARNING in the PHP core Fatal compile-time errors. This is like an E _ ERROR generated by the Zend Scripting Engine Non-fatal compile-time errors. This is like an 4 4 4 E _ WARNING generated by the Zend Scripting Engine Fatal user-generated error. This is like an E _ ERROR set 4 by the programmer using the PHP function trigger_error() Non-fatal user-generated warning. This is like an E _ WARNING set by the programmer using the PHP function trigger_error() 4 User-generated notice. This is like an E _ NOTICE set by 4 the programmer using the PHP function trigger_error() Run-time notices. PHP suggest changes to your code to help interoperability and compatibility of the code Catchable fatal error. This is like an E ERROR but can be caught by a user defined handle (see also set_error_handler()) All errors and warnings, except of level E _ STRICT 5 5 5 PHP Filesystem Introduction The filesystem functions allow you to access and manipulate the filesystem. Installation The filesystem functions are part of the PHP core. There is no installation needed to use these functions. Runtime Configuration The behavior of the filesystem functions is affected by settings in php.ini. Filesystem configuration options: Name allow_url_fopen user_agent Default "1" NULL Description Allows fopen()-type functions to work with URLs (available since PHP 4.0.4) Defines the user agent for PHP to send Changeable PI-IP INI SYSTEM PI-IP INI ALL
  11. default socket timeout from "60" auto_detect_line_endings "0" (available since PHP 4.3) Sets the default timeout, in seconds, for socket based streams (available since PHP 4.3) Defines the anonymous FTP password (your email address) When set to "1", PHP will examine the data read by fgets() and file() to see if it is using Unix, MS-Dos or Mac line-ending characters (available since PHP 4.3) PI-IP INI ALL PI-IP INI ALL PI-IP INI ALL Unix / Windows Compatibility When specifying a path on Unix platforms, the forward slash (/) is used as directory separator. However, on Windows platforms, both forward slash (/) and backslash ( \ ) can be used. PHP Filesystem Functions PHP: indicates the earliest version of PHP that supports the function. Function basename() chgrp() chmod() chown() clearstatcache() co dirname() disk free space() disk total space() diskfreespace() fclose() feof() fflush() fgetc() fgetcsv() fgets() fgetss() file() Description Returns the filename component of a Changes the file group Changes the file mode Changes the file owner Clears the file status cache Copies a file See unlink() or unset() path Returns the directory name component of a Returns the free space of a directory Returns the total size of a directory Alias of disk_free_space() Closes an open file Tests for end-of-file on an open file Flushes buffered output to an open file Returns a character from an open file path Parses a line from an open file, checking for CSV fields Returns a line from an open file Returns a line, with HTML and PHP tags removed, from an open file Reads a file into an array PHP 3 3 3 3 3 3 3 4 4 3 3 3 4 3 3 3 3 3
  12. file exists() Checks whether or not a file or directory exists file get contents() Reads a file into a string file put contents Writes a string to a file fileatime Returns the last access time of a file filectime() Returns the last change time of a file filegroup() Returns the group ID of a file fileinode() Returns the inode number of a file filemtime() Returns the last modification time of a file fileowner Returns the user ID (owner) of a file fileperms() Returns the permissions of a file filesize() Returns the file size filetype() Returns the file type flock() Locks or releases a file fnmatch() Matches a filename or string against a specified pattern fopen() Opens a file or URL f assthru Reads from an open file, until EOF, and writes the result to the output buffer fputcsv() Formats a line as CSV and writes it to an open file fputs() Alias of fwrite() Reads from an open file fsca nf() Parses input from an open file according to a specified format free k ( ) Seeks in an open file fstat() Returns information about an open file ftell() Returns the current position in an open file ftruncate() Truncates an open file to a specified length fwrite() Writes to an open file glob() Returns an array of filenames / directories matching a specified Checks whether a file is a directory Checks whether a file is executable is is is is is is is is dir() executable() file() link() readable() uploaded file() writable() writeable() pattern Checks whether a file is a regular file Checks whether a file is a link Checks whether a file is readable Checks whether a file was uploaded via Checks whether a file is writeable HTTP POST link() linkinfo() Istat() mkdir() Alias of is_writable() Creates a hard link Returns information about a hard link Returns information about a file or symbolic link Creates a directory 3 4 5 3 3 3 3 3 3 3 3 3 3 4 3 3 5 3 3 4 3 4 3 4 3 4 3 3 3 3 3 3 4 3 3 3 3 3
  13. move uploaded file() arse ini file pathinfo() pclose() popen() readfile() readlink() realpath() rename rewind() rmdir() set file buffer() stat() symlink() tempnam() tm file touch() umask unlink() Moves an uploaded file to a new location Parses a configuration file Returns information about a file path Closes a pipe opened by popen() Opens a pipe Reads a file and writes it to the output buffer Returns the target of a symbolic link Returns the absolute pathname Renames a file or directory Rewinds a file pointer Removes an empty directory Sets the buffer size of an open file Returns information about a file Creates a symbolic link Creates a unique temporary file Creates a unique temporary file Sets access and modification time of a file Changes file permissions for files Deletes a file PHP Filesystem Constants PHP: indicates the earliest version of PHP that supports the constant. 4 4 4 3 3 3 3 4 3 3 3 3 3 3 3 3 3 3 3 PHP Constant GLOB BRACE GLOB ONLYDIR GLOB MARK GLOB NOSORT GLOB NOCHECK GLOB NOESCAPE PATHINFO DIRNAME PATHINFO BASENAME PATHINFO EXTENSION USE INCLUDE PATH FILE FILE APPEND IGNORE NEW LINES FILE SKIP EMPTY LINES FILE Description
  14. PHP Filter Introduction This PHP filters is used to validate and filter data coming from insecure sources, like user input. Installation The filter functions are part of the PHP core. There is no installation needed to use these functions. PHP Filter Functions PHP: indicates the earliest version of PHP that supports the function. Function fi Iter filter fi Iter filter filter filter fi Iter has var() id() input() input array() list() var array() var() Description Checks if a variable of a specified input type exist Returns the ID number of a specified filter Get input from outside the script and filter it Get multiple inputs from outside the script and filters them Returns an array of all supported filters Get multiple variables and filter them Get a variable and filter it Description Call a user-defined function to filter data PHP 5 5 5 5 5 5 5 PI-IP Filters ID Name FILTER CALLBACK FILTER SANITIZE STRING FILTER SANITIZE STRIPPED FILTER SANITIZE ENCODED FILTER SANITIZE SPECIAL CHARS FILTER SANITIZE EMAIL FILTER SANITIZE URL FILTER SANITIZE NUMBER INT FILTER SANITIZE NUMBER FLOAT Strip tags, optionally strip or encode special cha racters Alias of "string" filter URL-encode string, optionally strip or encode special characters HTML-escape "'& and characters with ASCII value less than 32 Remove all characters, except letters, digits and Remove all characters, except letters, digits and $- Remove all characters, except digits and +- Remove all characters, except digits, +- and
  15. FILTER SANITIZE MAGIC QUOTES FILTER UNSAFE RAW FILTER VALIDATE INT FILTER VALIDATE BOOLEAN FILTER VALIDATE FLOAT FILTER VALIDATE REGEXP FILTER VALIDATE URL FILTER VALIDATE EMAIL FILTER VALIDATE IP FTP Introduction PI-IP optionally .,eE Apply addslashes() Do nothing, optionally strip or encode special cha racters Validate value as integer, optionally from the specified range Return TRUE for 1 " ", "true", "on" and "yes", FALSE for "0", "false", "off", "no", and NULL otherwise Validate value as float Validate value against regexp, a Perl-compatible regular expression Validate value as URL, optionally with required components Validate value as e-mail Validate value as IP address, optionally only IPv4 or IPv6 or not from private or reserved ranges The FTP functions give client access to file servers through the File Transfer Protocol (FTP). The FTP functions are used to open, login and close connections, as well as upload, download, rename, delete, and get information on files from file servers. Not all of the FTP functions will work with every server or return the same results. The FTP functions became available with PI-IP 3. These functions are meant for detailed access to an FTP server. If you only wish to read from or write to a file on an FTP server, consider using the ftp:// wrapper with the Filesystem functions. Installation The windows version of PHP has built-in support for the FTP extension. So, the FTP functions will work automatically. However, if you are running the Linux version of PHP, you will have to compile PHP with - enable-ftp(PHP 4+) or --with-ftp (PHP 3) to get the FTP functions to work. PI-IP FTP Functions PHP: indicates the earliest version of PHP that supports the function. Function ftp alloc() Description Allocates space for a file to be uploaded to the FTP server PHP 5
  16. ftp ftp ftp_ ftp ft ftp ftp ftp ftp ftp_ ftp ftp ftp ftp ftp ftp ft ftp ftp ftp ftp ftp ftp ftp ftp_ ftp ftp ftp ftp ftp ftp ftp_ cdup() chdir() chmod() close() connect exec ( ) fget() fput() get option() get() mdtm() mkdir() nb continue() nb fget() nb fput() nb put() nlist() pasv() put() pwd() quit() raw() rawlist() rename() rmdir() set option() site() size() SSI connect() systype() Changes the current directory to the parent directory on the FTP Changes the current directory on the FTP server Sets permissions on a file via FTP Closes an FTP connection Opens an FTP connection Deletes a file on the FTP server Executes a program/command on the FTP server Downloads a file from the FTP server and saves it to an open file Uploads from an open file and saves it to a file on the FTP server Returns runtime behaviors of the FTP connection Downloads a file from the FTP server Logs on to an FTP connection Returns the last modified time of a specified file Creates a new directory on the FTP server Continues retrieving/sending a file (non-blocking) Downloads a file from the FTP server and saves it to an open file (non-blocking) Uploads from an open file and saves it to a file on the FTP server (non-blocking) Downloads a file from the FTP server (non-blocking) Uploads a file to the FTP server (non-blocking) Lists the files in a specified directory on the FTP server Turns passive mode on or off Uploads a file to the FTP server Returns the current directory name Alias of ftp_close() Sends a raw command to the FTP server Returns a detailed list of files in the specified directory Renames a file or directory on the FTP server Removes a directory on the FTP server Sets runtime options for the FTP connection Sends a SITE command to the server Returns the size of the specified file Opens a secure SSL-FTP connection Returns the system type identifier of the FTP server 3 3 5 4 3 3 4 3 3 4 3 3 3 3 4 4 4 4 4 3 3 3 3 3 5 3 3 3 4 3 3 4 3 PI-IP FTP Constants PHP: indicates the earliest version of PHP that supports the constant.
  17. Constant FTP ASCII FTP TEXT FTP BINARY FTP IMAGE FTP TIMEOUT SEC FTP AUTOSEEK FTP AUTORESUME FTP FAILED FINISHED FTP MOREDATA FTP Description Determine resume position and start position for get and put requests automatically Asynchronous transfer has failed Asynchronous transfer has finished Asynchronous transfer is still active PI-IP I-ITTP Introduction The HTTP functions let you manipulate information sent to the browser by the Web server, before any other output has been sent. Installation The directory functions are part of the PHP core. There is no installation needed to use these functions. PI-IP I-ITTP Functions PHP: indicates the earliest version of PHP that supports the function. Function header() headers list() headers sent() setcookie() setrawcookie() PI-IP I-ITTP Constants None. Description Sends a raw HTTP header to a client Returns a list of response headers sent (or ready to send) Checks if / where the HITP headers have been sent Sends an HTTP cookie to a client Sends an HTTP cookie without URL encoding the cookie value PHP 3 3 3 3 3 4 4 4 4 4 PHP 3 5 3 3 5
  18. PHP libxml Introduction The libxml functions and constants are used together with SimpleXML, XSLT and DOM functions. Installation These functions require the libxml package. Download at xmlsoft.org PHP libxml Functions PHP: indicates the earliest version of PHP that supports the function. Function libxml clear errors() libxml get errors() libxml get last error() libxml_set_streams_context() libxml use internal errors() libxml Constants PI-IP Function LIBXML COMPACT LIBXML DTDATTR DTDLOAD LIBXML LIBXML DTDVALID NOBLANKS LIBXML NOCDATA LIBXML NOEMPT(TAG LIBXML NOENT LIBXML NOERROR LIBXML NONET LIBXML NOWARNING LIBXML NOXMLDECL LIBXML Description Clear libxml error buffer Retrieve array of errors Retrieve last error from libxml Set the streams context for the next libxml document load or write Disable libxml errors and allow user to fetch error information as needed Description PHP 5 5 5 5 5 PHP Set small nodes allocation optimization. This may improve 5 the application performance Set default DTD attributes Load external subset Validate with the DTD Remove blank nodes Set CDATA as text nodes Change empty tags (e.g. to ), only available in the DOMDocument->save() and DOMDocument->saveXML() functions Substitute entities Do not show error reports Stop network access while loading documents Do not show warning reports Drop the XML declaration when saving a document 5 5 5 5 5 5 5 5 5 5 5
  19. NSCLEAN LIBXML LIBXML XINCLUDE ERR ERROR LIBXML LIBXML ERR FATAL ERR NONE LIBXML ERR WARNING LIBXML LIBXML VERSION DOTTED VERSION LIBXML PHP Mail Introduction Remove excess namespace declarations Use Xlnclude substitution Get recoverable errors Get fatal errors Get no errors Get simple warnings Get libxml version (e.g. 20605 or 20617) Get dotted libxml version (e.g. 2.6.5 or 2.6.17) 5 5 5 5 5 5 5 5 The mail() function allows you to send emails directly from a script. Requirements For the mail functions to be available, PHP requires an installed and working email system. The program to be used is defined by the configuration settings in the php.ini file. Installation The mail functions are part of the PHP core. There is no installation needed to use these functions. Runtime Configuration The behavior of the mail functions is affected by settings in the php.ini file. Mail configuration options: Name SMTP smtp_port sendmail from sendmail_path Default "localhost" NULL NULL Description Windows only: The DNS name or IP address of the SMTP server Windows only: The SMTP port number. Available since PHP 4.3 Windows only: Specifies the "from" address to be used in email sent from PHP Changeable PHP INI ALL PHP INI ALL PI-IP INI ALL Unix systems only: Specifies where the PI-IP INI SYSTEM sendmail program can be found (usually /usr/sbin/sendmail or /usr/lib/sendmail)
  20. PHP Mail Functions PHP: indicates the earliest version of PHP that supports the function. Function ezmlm_hash() mail() Description Calculates the hash value needed by the EZMLM mailing list system Allows you to send emails directly from a script PHP Mail Constants None. PHP Math Introduction The math functions can handle values within the range of integer and float types. Installation The math functions are part of the PHP core. There is no installation needed to use these functions. PHP Math Functions PHP: indicates the earliest version of PHP that supports the function. Function abs() acos() acosh() asin() asinh() atan() atan2() atanh() base convert() bindec() ceil() Description Returns the absolute value of a number Returns the arccosine of a number Returns the inverse hyperbolic cosine of a number Returns the arcsine of a number Returns the inverse hyperbolic sine of a number Returns the arctangent of a number as a numeric value between - PI/ 2 and PI/ 2 radians Returns the angle theta of an (x,y) point as a numeric value between -PI and PI radians Returns the inverse hyperbolic tangent of a number Converts a number from one base to another Converts a binary number to a decimal number Returns the value of a number rounded upwards to the nearest PHP 3 3 PHP 3 3 4 3 4 3 3 4 3 3 3
  21. CQSQ cosh() decbin() dechex() decoct() deg2rad() exp ( ) ex ml floor() fmod() etrandmax hexdec() hypot() is finite is infinite() is nan() lcg value() log() log10() loglp() max() min() mt getrandmax() mt rand() mt srand() octdec() pow() rad2deg() rand() round() sin() sinh() sqrt() srand() integer Returns the cosine of a number Returns the hyperbolic cosine of a number Converts a decimal number to a binary number Converts a decimal number to a hexadecimal number Converts a decimal number to an octal number Converts a degree to a radian number Returns the value of EX Returns the value of EX - 1 3 4 3 3 3 3 3 4 Returns the value of a number rounded downwards to the nearest 3 integer Returns the remainder (modulo) of the division of the arguments Returns the maximum random number that can be returned by a call to the rand() function Converts a hexadecimal number to a decimal number Returns the length of the hypotenuse of a right-angle triangle Returns true if a value is a finite number Returns true if a value is an infinite number Returns true if a value is not a number Returns a pseudo random number in the range of (0, 1) Returns the natural logarithm (base E) of a number Returns the base-IO logarithm of a number Returns log(l+number) Returns the number with the highest value of two specified numbers Returns the number with the lowest value of two specified numbers Returns the largest possible value that can be returned by mt_rand() Returns a random integer using Mersenne Twister algorithm Seeds the Mersenne Twister random number generator Converts an octal number to a decimal number Returns the value of PI Returns the value of x to the power of y Converts a radian number to a degree Returns a random integer Rounds a number to the nearest integer Returns the sine of a number Returns the hyperbolic sine of a number Returns the square root of a number Seeds the random number generator 4 3 3 4 4 4 4 4 3 3 4 3 3 3 3 3 3 3 3 3 3 3 3 4 3 3
  22. tan() tanh() Returns the tangent of an angle Returns the hyperbolic tangent of an angle PHP Math Constants PHP: indicates the earliest version of PHP that supports the constant. Constant M M M M M M M M M M M M M M M E EULER LNPI LN2 LNIO LOG2E LOGIOE 1 2 2 PI PI SQRTPI 2 SQRTPI SQRT1_2 SQRT2 SQRT3 Description Returns e (approx. 2.718) Returns Euler's constant (approx. 0.577) Returns the natural logarithm of PI (approx. 1.144) Returns the natural logarithm of 2 (approx. 0.693) Returns the natural logarithm of 10 (approx. 2.302) Returns the base-2 logarithm of E (approx. 1.442) Returns the base-IO logarithm of E (approx. 0.434) Returns PI (approx. 3.14159) Returns PI/ 2 (approx. 1.570) Returns PI/4 (approx. 0.785) Returns I/PI (approx. 0.318) Returns 2/PI (approx. 0.636) Returns the square root of PI (approx. 1.772) Returns 2/square root of PI (approx. 1.128) Returns the square root of 1/2 (approx. 0.707) Returns the square root of 2 (approx. 1.414) Returns the square root of 3 (approx. 1.732) 3 4 PHP 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 PHP Miscellaneous Introduction The misc. functions were only placed here because none of the other categories seemed to fit. Installation The misc functions are part of the PHP core. There is no installation needed to use these functions. Runtime Configuration The behavior of the misc functions is affected by settings in the php.ini file.
  23. Misc. configuration options: connection_timeout() Name ignore_user_abort highlight.string highlight.comment highlight.keyword highlight.bg highlight.default highlight.html browscap Default "#DDOOOO" "#007700" " # FFFFFF" NULL Description FALSE indicates that scripts will be terminated as soon as they try to output something after a client has aborted their connection Color for highlighting a string in PHP syntax Color for highlighting PHP comments Color for syntax highlighting PHP keywords (e.g. parenthesis and semicolon) Color for background Default color for PHP syntax Color for HTML code Name and location of browser-capabilities file (e.g. browscap.ini) Changeable PI-IP INI ALL PI-IP INI ALL PI-IP INI ALL PI-IP INI ALL PHP INI ALL PHP INI ALL PHP INI ALL PI-IP INI SYSTEM PHP Misc. Functions PHP: indicates the earliest version of PHP that supports the function. Function connection connection constant() define() defined() die() exit() aborted() status() get browser() highlight file() highlight string() ignore user abort() pack() php_check_syntax() php strip whitespace() show source() Description Checks whether the client has disconnected Returns the current connection status Deprecated in PHP 4.0.5 Returns the value of a constant Defines a constant Checks whether a constant exists Prints a message and exits the current script Evaluates a string as PHP code Prints a message and exits the current script Returns the capabilities of the user's browser Outputs a file with the PHP syntax highlighted Outputs a string with the PHP syntax highlighted Sets whether a remote client can abort the running of a script Packs data into a binary string Deprecated in PHP 5.0.5 Returns the source code of a file with PHP comments and whitespace removed Alias of highlight_file() PHP 3 3 3 4 3 3 3 3 3 3 4 4 3 3 5 5 4
  24. sleep() time nanoslee time sleep until() uni id unpack() usleep() Delays code execution for a number of seconds Delays code execution for a number of seconds and nanoseconds Delays code execution until a specified time Generates a unique ID Unpacks data from a binary string Delays code execution for a number of microseconds PHP Misc. Constants PHP: indicates the earliest version of PHP that supports the constant. Constant Description CONNECTION ABORTED CONNECTION NORMAL CONNECTION TIMEOUT COMPILER HALT OFFSET PHP MySQL Introduction The MySQL functions allows you to access MySQL database servers. Installation For the MySQL functions to be available, you must compile PHP with MySQL support. For compiling, use --with-mysql=DIR (the optional DIR points to the MySQL directory). Note: For full functionality of MySQL versions greater than 4.1. , use the MySQLi extension instead. If you would like to install both the mysql extension and the mysqli extension you should use the same client library to avoid any conflicts. Installation on Linux Systems PHP 5+: MySQL and the MySQL library is not enabled by default. Use the --with- mysql=DIRconfigure option to include MySQL support and download headers and libraries fromwww.mysql.com. Installation on Windows Systems PHP 5+: MySQL is not enabled by default, so the php_mysql.dll must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution, and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. 3 5 5 3 3 3 PHP 5
  25. To enable any PHP extension, the PHP extension_dir setting (in the php.ini file) should be set to the directory where the PHP extensions are located. An example extension_dir value is c:\php\ext. Note: If you get the following error when starting the web server: "Unable to load dynamic library './php_mysql.dll"', this is because php_mysql.dll or libmysql.dll cannot be found by the system. Runtime Configuration The behavior of the MySQL functions is affected by settings in the php.ini file. MySQL configuration options: "-1" "-1" Name mysql.allow_persistent mysql.max_persistent mysql.max_links mysql.trace_mode mysql.default_port mysql.default_socket mysql.default_host mysql.default_user Default "1" NULL NULL NULL NULL Description Whether or not to allow persistent connections The maximum number of persistent connections per process The maximum number of connections per process (persistent connections included) Trace mode. When set to "1", warnings and SQL-errors will be displayed. Available since PHP 4.3 The default TCP port number to use The default socket name to use. Available since PHP 4.0.1 The default server host to use (doesn't apply in SQL safe mode) The default user name to use (doesn't apply in SQL safe mode) The default password to use (doesn't apply in SQL safe mode) Connection timeout in seconds Changeable PI-IP INI SYSTEM PHP INI SYSTEM PI-IP INI SYSTEM PHP INI ALL PHP INI ALL Pi-IP INI ALL PI-IP INI ALL PI-IP INI ALL PI-IP INI ALL PHP INI ALL mysql.default_password NULL mysql.connect_timeout "60" Resource Types There are two resource types used in the MySQL extension. The first one is the link_identifier for a database connection, the second is a resource which holds the result of a query. Note: Most MySQL functions accept link_identifier as the last optional parameter. If it is not provided, the last opened connection is used.
  26. PI-IP MySQL Functions PHP: indicates the earliest version of PHP that supports the function. Function mysql affected rows() mysql_change_user() mysql client encoding() mysql close() mysql connect() mysql_create_db() mysql data seek() mysql db name() mysql_db_query() mysql_drop db() mysql errno() mysql error() mysql_escape_string() mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql fetch fetch fetch fetch fetch fetch field field field field field field free array() assoc() field() lengths() object() row() flags() leno name() seek() table() type() result() get client info() get host info() get proto info() Description Returns the number of affected rows in the previous MySQL operation Deprecated. Changes the user of the current MySQL connection Returns the name of the character set for the current connection Closes a non-persistent MySQL connection Opens a non-persistent MySQL connection Deprecated. Creates a new MySQL database. Use mysql_query() instead Moves the record pointer Returns a database name from a call to mysql_list_dbs() Deprecated. Sends a MySQL query. Use mysql_select_db() and mysql_query() instead Deprecated. Deletes a MySQL database. Use mysql_query() instead Returns the error number of the last MySQL operation Returns the error description of the last MySQL operation Deprecated. Escapes a string for use in a mysql_query. Use mysql_real_escape_string() instead Returns a row from a recordset as an associative array and/or a numeric array Returns a row from a recordset as an associative array Returns column info from a recordset as an object Returns the length of the contents of each field in a result row Returns a row from a recordset as an object Returns a row from a recordset as a numeric array Returns the flags associated with a field in a recordset Returns the maximum length of a field in a recordset Returns the name of a field in a recordset Moves the result pointer to a specified field Returns the name of the table the specified field is in Returns the type of a field in a recordset Free result memory Returns MySQL client info Returns MySQL host info Returns MySQL protocol info PHP 3 3 4 3 3 3 3 3 3 3 3 3 4 3 4 3 3 3 3 3 3 3 3 3 3 3 4 4 4
  27. Since PHP 4.3 it has been possible to specify additional flags for the mysql_connect() and mysql_pconnect() functions: PHP: indicates the earliest version of PHP that supports the constant. mysql get server info() mysql info() mysql insert id() mysql list dbs() mysql_list_fields() mysql list processes() mysql_list_tables() mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql mysql PI-IP MYSQL_CLIENT IGNORE SPACE num fields() num rows() pconnect() ping() query() real escape result() select db() stat() mysql_tablename() thread id() string() Returns MySQL server info Returns information about the last query Returns the AUTO _ INCREMENT ID generated from the previous INSERT operation Lists available databases on a MySQL server Deprecated. Lists MySQL table fields. Use mysql_query() instead Lists MySQL processes Deprecated. Lists tables in a MySQL database. Use mysql_query() instead Returns the number of fields in a recordset Returns the number of rows in a recordset Opens a persistent MySQL connection Pings a server connection or reconnects if there is no connection Executes a query on a MySQL database Escapes a string for use in SQL statements Returns the value of a field in a recordset Sets the active MySQL database Returns the current system status of the MySQL server Deprecated. Returns the table name of field. Use mysql_query() instead Returns the current thread ID Executes a query on a MySQL database (without fetching / buffering the result) unbuffered query() MySQL Constants Constant MYSQL_CLIENT COMPRESS MYSQL_CLIENT INTERACTIVE MYSQL_CLIENT SSL Description Use compression protocol Allow space after function names Allow interactive timeout seconds of inactivity before closing the connection 4 4 3 3 3 4 3 3 3 3 4 3 4 3 3 4 3 4 4 PHP 4.3 4.3 4.3 Use SSL encryption (only available with version 4+ 4.3 of the MySQL client library)
  28. The mysql_fetch_array() function uses a constant for the different types of result arrays. The following constants are defined: Constant MYSQL_ASSOC MYSQL_BOTH MYSQL_NUM Description Columns are returned into the array with the fieldname as the array index Columns are returned into the array having both a numerical index and the fieldname as the array index Columns are returned into the array having a numerical index (index starts at 0) PHP SimpleXML Introduction The SimpleXML functions lets you convert XML to an object. This object can be processed, like any other object, with normal property selectors and array iterators. Some of these functions requires the newest PHP build. Installation The SimpleXML functions are part of the PHP core. There is no installation needed to use these functions. PI-IP SimpleXML Functions PHP: indicates the earliest version of PHP that supports the function. Function construct() addAttribute() addChild() asXML() attributes() children() getDocNamespaces() getName() getNamespace() registerXPathNamespace() simplexml import dom() simplexml load file() Description Creates a new SimpleXMLElement object Adds an attribute to the SimpleXML element Adds a child element the SimpleXML element Gets an XML string from a SimpleXML element Gets a SimpleXML element's attributes Gets the children of a specified node Gets the namespaces of an XML document Gets the name of a SimpleXML element Gets the namespaces from XML data Creates a namespace context for the next XPath query Gets a SimpleXMLElement object from a DOM node Gets a SimpleXMLElement object from an XML document PHP PHP 5 5 5 5 5 5 5 5 5 5 5 5
  29. simplexml load string() Gets a SimpleXMLElement object from an XML string Runs an XPath query on XML data PHP SimpleXML Constants None PHP String Introduction The string functions allow you to manipulate strings. Installation The string functions are part of the PHP core. There is no installation needed to use these functions. PHP String Functions PHP: indicates the earliest version of PHP that supports the function. Function addcslashes() addslashes() bin2hex() chop() chr() chunk split() convert cyr string() convert uudecode() convert uuencode() count chars() crc32() crypt() echo() explode() Description Returns a string with backslashes in front of the specified characters Returns a string with backslashes in front of predefined characters Converts a string of ASCII characters to hexadecimal values Alias of rtrim() Returns a character from a specified ASCII value Splits a string into a series of smaller parts Converts a string from one Cyrillic character-set to another Decodes a uuencoded string Encodes a string using the uuencode algorithm Returns how many times an ASCII character occurs within 4 a string and returns the information Calculates a 32-bit CRC for a string One-way string encryption (hashing) Outputs strings Breaks a string into an array 5 5 PHP 4 3 3 3 3 3 3 5 5 4 3 3 3
  30. fprintf() et html translation table hebrev() hebrevc() html entity decode() htmlentities() htmlspecialchars decode() htmls ecialchars implode() join() levenshtein() localeconv() ltrim() md5() md5 file() metaphone() money format() nl Ian info n12br() number format() ord() parse str() print() printf() quoted printable quotemeta() rtrim() setlocale() shal() shal file() similar text() soundex() sprintf() sscanf() str ireplace() str pad() str repeat() decode() Writes a formatted string to a specified output stream Returns the translation table used by htmlspecialchars() and htmlentities() Converts Hebrew text to visual text Converts Hebrew text to visual text and new lines (\n) into Converts HTML entities to characters Converts characters to HTML entities Converts some predefined HTML entities to characters Converts some predefined characters to HTML entities Returns a string from the elements of an array Alias of implode() Returns the Levenshtein distance between two strings Returns locale numeric and monetary formatting information Strips whitespace from the left side of a string Calculates the MD5 hash of a string Calculates the MD5 hash of a file Calculates the metaphone key of a string Returns a string formatted as a currency string Returns specific local information Inserts HTML line breaks in front of each newline in a string Formats a number with grouped thousands Returns the ASCII value of the first character of a string Parses a query string into variables Outputs a string Outputs a formatted string Decodes a quoted-printable string Quotes meta characters Strips whitespace from the right side of a string Sets locale information Calculates the SHA-I hash of a string Calculates the SHA-I hash of a file Calculates the similarity between two strings Calculates the soundex key of a string Writes a formatted string to a variable Parses input from a string according to a format Replaces some characters in a string (case-insensitive) Pads a string to a new length Repeats a string a specified number of times 5 4 3 3 4 3 5 3 3 3 3 4 3 3 4 4 4 4 3 3 3 3 3 3 3 3 3 3 4 4 3 3 3 4 5 4 4
  31. str replace() str rot13 str shuffle() str split() str word count() strcasecmp() strchr() strcmp() strcoll() strcspn() strip tags() stripcslashes() stripslashes() stripos() stristr() strlen() strnatcasecmp() strnatcmp() strncasecmp() strncmp() strpbrk() strpos() strrchr() strrev() strripos() strrpos() strspn() strstr() strtok() strtolower() strtoupper() Replaces some characters in a string (case-sensitive) Performs the ROT 13 encoding on a string Randomly shuffles all characters in a string Splits a string into an array Count the number of words in a string Compares two strings (case-insensitive) Finds the first occurrence of a string inside another string (alias of strstr()) Compares two strings (case-sensitive) Locale based string comparison Returns the number of characters found in a string before any part of some specified characters are found Strips HTML and PHP tags from a string Unquotes a string quoted with addcslashes() Unquotes a string quoted with addslashes() Returns the position of the first occurrence of a string inside another string (case-insensitive) Finds the first occurrence of a string inside another string (case-insensitive) Returns the length of a string Compares two strings using a "natural order" algorithm (case-insensitive) Compares two strings using a "natural order" algorithm (case-sensitive) String comparison of the first n characters (case- insensitive) String comparison of the first n characters (case- sensitive) Searches a string for any of a set of characters Returns the position of the first occurrence of a string inside another string (case-sensitive) Finds the last occurrence of a string inside another string Reverses a string Finds the position of the last occurrence of a string inside another string (case-insensitive) Finds the position of the last occurrence of a string inside another string (case-sensitive) Returns the number of characters found in a string that contains only characters from a specified charlist Finds the first occurrence of a string inside another string (case-sensitive) Splits a string into smaller strings Converts a string to lowercase letters Converts a string to uppercase letters 3 4 4 5 4 3 3 3 4 3 3 4 3 5 3 3 4 4 4 4 5 3 3 3 5 3 3 3 3 3 3
  32. strtr() substr() substr compare() substr count() substr replace() trim() ucfirst ucwords() vfprintf() vprintf() vsprintf() wordwrap() PHP String Constants Translates certain characters in a string Returns a part of a string Compares two strings from a specified start position (binary safe and optionally case-sensitive) Counts the number of times a substring occurs in a string Replaces a part of a string with another string Strips whitespace from both sides of a string Converts the first character of a string to uppercase Converts the first character of each word in a string to uppercase Writes a formatted string to a specified output stream Outputs a formatted string Writes a formatted string to a variable Wraps a string to a given number of characters PHP: indicates the earliest version of PHP that supports the constant. 3 3 5 4 4 3 3 3 5 4 4 4 PHP Constant CRYPT SALT LENGTH CRYPT STD DES CRYPT EXT DES CRYPT MD5 CRYPT BLOWFISH HTML SPECIALCHARS HTML ENTITIES ENT COMPAT ENT_QUOTES ENT_NOQUOTES CHAR MAX LC CTYPE LC NUMERIC LC TIME LC COLLATE Description Contains the length of the default encryption method for the system. For standard DES encryption, the length is 2 Set to 1 if the standard DES-based encryption with a 2 character salt is supported, 0 otherwise Set to 1 if the extended DES-based encryption with a 9 character salt is supported, 0 otherwise Set to 1 if the MD5 encryption with a 12 character salt starting with $1$ is supported, 0 otherwise Set to 1 if the Blowfish encryption with a 16 character salt starting with $2$ or $2a$ is supported, 0 otherwise0
  33. LC MONETARY LC ALL LC MESSAGES STR PAD LEFT STR PAD RIGHT STR PAD BOTH PHP XML Parser Introduction The XML functions lets you parse, but not validate, XML documents. XML is a data format for standardized structured document exchange. More information on XML can be found in our XML Tutorial. This extension uses the Expat XML parser. Expat is an event-based parser, it views an XML document as a series of events. When an event occurs, it calls a specified function to handle it. Expat is a non-validating parser, and ignores any DTDs linked to a document. However, if the document is not well formed it will end with an error message. Because it is an event-based, non validating parser, Expat is fast and well suited for web applications. The XML parser functions lets you create XML parsers and define handlers for XML events. Installation The XML functions are part of the PHP core. There is no installation needed to use these functions. PI-IP XML Parser Functions PHP: indicates the earliest version of PHP that supports the function. Function utf8 utf8 xml xml xml decode() encode() error string() get current byte index() get current column number() Description Decodes an UTF-8 string to ISO-8859-1 Encodes an ISO-8859-1 string to UTF-8 Gets an error string from the XML parser Gets the current byte index from the XML parser Gets the current column number from the XML parser PHP 3 3 3 3 3
  34. xml xml xml xml xml xml xml xml xml xml xml xml xml xml xml xml xml xml xml get current line number() get error code() parse() parse into struct() parser create ns() parser create() parser free() parser get option() parser set option() Gets the current line number from the XML 3 set set set set set set set set set set character data handler() default handler() element handler() _end_namespace_decl_handler() external entity ref handler() notation decl handler() object() processing instruction handler() start _ namespace_decl_handler() unparsed entity decl handler() parser Gets an error code from the XML parser Parses an XML document Parse XML data into an array Create an XML parser with namespace support Create an XML parser Free an XML parser Get options from an XML parser Set options in an XML parser Set handler function for character data Set default handler function Set handler function for start and end element of elements Set handler function for the end of namespace declarations Set handler function for external entities Set handler function for notation declarations Use XML Parser within an object Set handler function for processing instruction Set handler function for the start of namespace declarations Set handler function for unparsed entity declarations 3 3 3 4 3 3 3 3 3 3 3 4 3 3 4 3 4 3 PHP XML Parser Constants Constant XML XML XML XML XML XML XML XML XML XML ERROR NONE (integer) ERROR NO_MEMORY (integer) ERROR SYNTAX (integer) ERROR NO_ELEMENTS (integer) ERROR INVALID_TOKEN (integer) ERROR UNCLOSED_TOKEN (integer) ERROR PARTIAL_CHAR (integer) ERROR TAG_MISMATCH (integer) ERROR DUPLICATE_AITRIBUTE (integer) ERROR (integer)
  35. XML XML XML XML XML XML XML XML XML XML XML XML ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR XML OPTION XML OPTION XML OPTION XML OPTION (integer) UNDEFINED_ENTITY (integer) (integer) ERROR ASYNC_ENTITY (integer) (integer) (integer) ERROR (integer) (integer) UNKNOWN_ENCODING (integer) ERROR INCORRECT_ENCODING (integer) (integer) (integer) CASE_FOLDING (integer) TARGET_ENCODING (integer) SKIP_TAGSTART (integer) SKIP_WHITE (integer) File Introduction PI-IP Zip The Zip files functions allows you to read ZIP files. Installation For the Zip file functions to work on your server, these libraries must be installed: • The ZZIPlib library by Guido Draheim: Download the ZZIPlib library • The Zip PELC extension: Download the Zip PELC extension Installation on Linux Systems PHP 5+: Zip functions and the Zip library is not enabled by default and must be downloaded from the links above. Use the --with-zip=DIR configure option to include Zip support. Installation on Windows Systems PHP 5+: Zip functions is not enabled by default, so the php_zip.dll and the ZZIPlib library must be downloaded from the link above. php_zip.dll must be enabled inside of php.ini. To enable any PHP extension, the PHP extension_dir setting (in the php.ini file) should be set to the directory where the PHP extensions are located. An example extension_dir value is PI-IP Zip File Functions
  36. PHP: indicates the earliest version of PHP that supports the function. Function zip zip zip zip zip zip zip zip zip entry entry entry- entry entry open() read() close() compressedsize() compressionmethod() filesize() name() open() read() Description Closes a ZIP file Closes an entry in the ZIP file Returns the compressed size of an entry in the ZIP file Returns the compression method of an entry in the ZIP file Returns the actual file size of an entry in the ZIP file Returns the name of an entry in the ZIP file Opens an entry in the ZIP file for reading Reads from an open entry in the ZIP file Opens a ZIP file Reads the next entry in a ZIP file PHP 4 4 4 4 4 4 4 4 4 4 PI-IP Zip File Constants NONE