Головна »»» Web »»» PHP

Шпаргалка по php

Array

Array Constants

  • CASE_LOWER
  • Used with array_change_key_case() to convert array keys to lower case
  • CASE_UPPER
  • Used with array_change_key_case() to convert array keys to upper case
  • SORT_ASC
  • Used with array_multisort() to sort in ascending order
  • SORT_DESC
  • Used with array_multisort() to sort in descending order
  • SORT_REGULAR
  • Used to compare items normally
  • SORT_NUMERIC
  • Used to compare items numerically
  • SORT_STRING
  • Used to compare items as strings
  • SORT_LOCALE_STRING
  • Used to compare items as strings, based on the current locale
  • COUNT_NORMAL
  • COUNT_RECURSIVE
  • EXTR_OVERWRITE
  • EXTR_SKIP
  • EXTR_PREFIX_SAME
  • EXTR_PREFIX_ALL
  • EXTR_PREFIX_INVALID
  • EXTR_PREFIX_IF_EXISTS
  • EXTR_IF_EXISTS
  • EXTR_REFS

String

String Constants

  • CRYPT_SALT_LENGTH
  • Contains the length of the default encryption method for the system. For standard DES encryption, the length is 2
  • CRYPT_STD_DES
  • Set to 1 if the standard DES-based encryption with a 2 character salt is supported, 0 otherwise
  • CRYPT_EXT_DES
  • Set to 1 if the extended DES-based encryption with a 9 character salt is supported, 0 otherwise
  • CRYPT_MD5
  • Set to 1 if the MD5 encryption with a 12 character salt starting with $ is supported, 0 otherwise
  • CRYPT_BLOWFISH
  • Set to 1 if the Blowfish encryption with a 16 character salt starting with $ or a$ is supported, 0 otherwise0
  • HTML_SPECIALCHARS
  • HTML_ENTITIES
  • ENT_COMPAT
  • ENT_QUOTES
  • ENT_NOQUOTES
  • CHAR_MAX
  • LC_CTYPE
  • LC_NUMERIC
  • LC_TIME
  • LC_COLLATE
  • LC_MONETARY
  • LC_ALL
  • LC_MESSAGES
  • STR_PAD_LEFT
  • STR_PAD_RIGHT
  • STR_PAD_BOTH

Date/Time

Date/Time Constants

  • DATE_ATOM
  • Atom (example: 2005-08-15T16:13:03+0000)
  • DATE_COOKIE
  • HTTP Cookies (example: Sun, 14 Aug 2005 16:13:03 UTC)
  • DATE_ISO8601
  • ISO-8601 (example: 2005-08-14T16:13:03+0000)
  • DATE_RFC822
  • RFC 822 (example: Sun, 14 Aug 2005 16:13:03 UTC)
  • DATE_RFC850
  • RFC 850 (example: Sunday, 14-Aug-05 16:13:03 UTC)
  • DATE_RFC1036
  • RFC 1036 (example: Sunday, 14-Aug-05 16:13:03 UTC)
  • DATE_RFC1123
  • RFC 1123 (example: Sun, 14 Aug 2005 16:13:03 UTC)
  • DATE_RFC2822
  • RFC 2822 (Sun, 14 Aug 2005 16:13:03 +0000)
  • DATE_RSS
  • RSS (Sun, 14 Aug 2005 16:13:03 UTC)
  • DATE_W3C
  • World Wide Web Consortium (example: 2005-08-14T16:13:03+0000)

Directory

Directory Constants

  • DIRECTORY_SEPARATOR
  • PATH_SEPARATOR

Error

Error Constants

  • E_ERROR1
  • Fatal run-time errors. Errors that cannot be recovered from. Execution of the script is halted
  • E_WARNING2
  • Non-fatal run-time errors. Execution of the script is not halted
  • E_PARSE4
  • Compile-time parse errors. Parse errors should only be generated by the parser
  • E_NOTICE8
  • Run-time notices. The script found something that might be an error, but could also happen when running a script normally
  • E_CORE_ERROR16
  • Fatal errors at PHP startup. This is like an E_ERROR in the PHP core
  • E_CORE_WARNING32
  • Non-fatal errors at PHP startup. This is like an E_WARNING in the PHP core
  • E_COMPILE_ERROR64
  • Fatal compile-time errors. This is like an E_ERROR generated by the Zend Scripting Engine
  • E_COMPILE_WARNING128
  • Non-fatal compile-time errors. This is like an E_WARNING generated by the Zend Scripting Engine
  • E_USER_ERROR256
  • Fatal user-generated error. This is like an E_ERROR set by the programmer using the PHP function trigger_error()
  • E_USER_WARNING512
  • Non-fatal user-generated warning. This is like an E_WARNING set by the programmer using the PHP function trigger_error()
  • E_USER_NOTICE1024
  • User-generated notice. This is like an E_NOTICE set by the programmer using the PHP function trigger_error()
  • E_STRICT2048
  • Run-time notices. PHP suggest changes to your code to help interoperability and compatibility of the code
  • E_RECOVERABLE_ERROR4096
  • Catchable fatal error. This is like an E_ERROR but can be caught by a user defined handle (see also set_error_handler())
  • E_ALL6143
  • All errors and warnings, except of level E_STRICT

Math

Math Constants

  • M_E
  • Returns e (approx. 2.718)
  • M_EULER
  • Returns Euler's constant (approx. 0.577)
  • M_LNPI
  • Returns the natural logarithm of PI (approx. 1.144)
  • M_LN2
  • Returns the natural logarithm of 2 (approx. 0.693)
  • M_LN10
  • Returns the natural logarithm of 10 (approx. 2.302)
  • M_LOG2E
  • Returns the base-2 logarithm of E (approx. 1.442)
  • M_LOG10E
  • Returns the base-10 logarithm of E (approx. 0.434)
  • M_PI
  • Returns PI (approx. 3.14159)
  • M_PI_2
  • Returns PI/2 (approx. 1.570)
  • M_PI_4
  • Returns PI/4 (approx. 0.785)
  • M_1_PI
  • Returns 1/PI (approx. 0.318)
  • M_2_PI
  • Returns 2/PI (approx. 0.636)
  • M_SQRTPI
  • Returns the square root of PI (approx. 1.772)
  • M_2_SQRTPI
  • Returns 2/square root of PI (approx. 1.128)
  • M_SQRT1_2
  • Returns the square root of 1/2 (approx. 0.707)
  • M_SQRT2
  • Returns the square root of 2 (approx. 1.414)
  • M_SQRT3
  • Returns the square root of 3 (approx. 1.732)

Calendar

Calendar Constants

  • CAL_GREGORIAN
  • Gregorian calendar
  • CAL_JULIAN
  • Julian calendar
  • CAL_JEWISH
  • Jewish calendar
  • CAL_FRENCH
  • French Republican calendar
  • CAL_NUM_CALS
  • CAL_DOW_DAYNO
  • CAL_DOW_SHORT
  • CAL_DOW_LONG
  • CAL_MONTH_GREGORIAN_SHORT
  • CAL_MONTH_GREGORIAN_LONG
  • CAL_MONTH_JULIAN_SHORT
  • CAL_MONTH_JULIAN_LONG
  • CAL_MONTH_JEWISH
  • CAL_MONTH_FRENCH
  • CAL_EASTER_DEFAULT
  • CAL_EASTER_ROMAN
  • CAL_EASTER_ALWAYS_GREGORIAN
  • CAL_EASTER_ALWAYS_JULIAN
  • CAL_JEWISH_ADD_ALAFIM_GERESH
  • CAL_JEWISH_ADD_ALAFIM
  • CAL_JEWISH_ADD_GERESHAYIM

FTP

FTP Constants

  • FTP_ASCII
  • FTP_TEXT
  • FTP_BINARY
  • FTP_IMAGE
  • FTP_TIMEOUT_SEC
  • FTP_AUTOSEEK
  • FTP_AUTORESUME
  • Determine resume position and start position for get and put requests automatically
  • FTP_FAILED
  • Asynchronous transfer has failed
  • FTP_FINISHED
  • Asynchronous transfer has finished
  • FTP_MOREDATA
  • Asynchronous transfer is still active

Libxml

Libxml Constants

  • LIBXML_COMPACT
  • Set small nodes allocation optimization. This may improve the application performance
  • LIBXML_DTDATTR
  • Set default DTD attributes
  • LIBXML_DTDLOAD
  • Load external subset
  • LIBXML_DTDVALID
  • Validate with the DTD
  • LIBXML_NOBLANKS
  • Remove blank nodes
  • LIBXML_NOCDATA
  • Set CDATA as text nodes
  • LIBXML_NOEMPTYTAG
  • Change empty tags (e.g.
    to

    ), only available in the DOMDocument->save() and DOMDocument->saveXML() functions
  • LIBXML_NOENT
  • Substitute entities
  • LIBXML_NOERROR
  • Do not show error reports
  • LIBXML_NONET
  • Stop network access while loading documents
  • LIBXML_NOWARNING
  • Do not show warning reports
  • LIBXML_NOXMLDECL
  • Drop the XML declaration when saving a document
  • LIBXML_NSCLEAN
  • Remove excess namespace declarations
  • LIBXML_XINCLUDE
  • Use XInclude substitution
  • LIBXML_ERR_ERROR
  • Get recoverable errors
  • LIBXML_ERR_FATAL
  • Get fatal errors
  • LIBXML_ERR_NONE
  • Get no errors
  • LIBXML_ERR_WARNING
  • Get simple warnings
  • LIBXML_VERSION
  • Get libxml version (e.g. 20605 or 20617)
  • LIBXML_DOTTED_VERSION
  • Get dotted libxml version (e.g. 2.6.5 or 2.6.17)

Mail

Mail Functions

Misc.

Misc. Constants

  • CONNECTION_ABORTED
  • CONNECTION_NORMAL
  • CONNECTION_TIMEOUT
  • __COMPILER_HALT_OFFSET__

MySQL

MySQL Constants

  • MYSQL_CLIENT_COMPRESS
  • Use compression protocol
  • MYSQL_CLIENT_IGNORE_SPACE
  • Allow space after function names
  • MYSQL_CLIENT_INTERACTIVE
  • Allow interactive timeout seconds of inactivity before closing the connection
  • MYSQL_CLIENT_SSL
  • Use SSL encryption (only available with version 4+ of the MySQL client library)
  • MYSQL_ASSOC
  • Columns are returned into the array with the fieldname as the array index
  • MYSQL_BOTH
  • Columns are returned into the array having both a numerical index and the fieldname as the array index
  • MYSQL_NUM
  • Columns are returned into the array having a numerical index (index starts at 0)

XML Parser

XML Parser Constants

  • XML_ERROR_NONE (integer)
  • XML_ERROR_NO_MEMORY (integer)
  • XML_ERROR_SYNTAX (integer)
  • XML_ERROR_NO_ELEMENTS (integer)
  • XML_ERROR_INVALID_TOKEN (integer)
  • XML_ERROR_UNCLOSED_TOKEN (integer)
  • XML_ERROR_PARTIAL_CHAR (integer)
  • XML_ERROR_TAG_MISMATCH (integer)
  • XML_ERROR_DUPLICATE_ATTRIBUTE (integer)
  • XML_ERROR_JUNK_AFTER_DOC_ELEMENT (integer)
  • XML_ERROR_PARAM_ENTITY_REF (integer)
  • XML_ERROR_UNDEFINED_ENTITY (integer)
  • XML_ERROR_RECURSIVE_ENTITY_REF (integer)
  • XML_ERROR_ASYNC_ENTITY (integer)
  • XML_ERROR_BAD_CHAR_REF (integer)
  • XML_ERROR_BINARY_ENTITY_REF (integer)
  • XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF (integer)
  • XML_ERROR_MISPLACED_XML_PI (integer)
  • XML_ERROR_UNKNOWN_ENCODING (integer)
  • XML_ERROR_INCORRECT_ENCODING (integer)
  • XML_ERROR_UNCLOSED_CDATA_SECTION (integer)
  • XML_ERROR_EXTERNAL_ENTITY_HANDLING (integer)
  • XML_OPTION_CASE_FOLDING (integer)
  • XML_OPTION_TARGET_ENCODING (integer)
  • XML_OPTION_SKIP_TAGSTART (integer)
  • XML_OPTION_SKIP_WHITE (integer)
 
03.03.2013
5202 переглядів