You are previewing PHP Functions Essential Reference.
O'Reilly logo
PHP Functions Essential Reference

Book Description

The PHP Functions Essential Reference is a simple, clear and authoritative function reference that clarifies and expands upon PHP's existing documentation.
The authors have spent time evaluating all of the PHP functions and have selected the essential functions to include in the printed book. This includes around 900 of the 1500 functions. The remaining functions will be covered in the same depth and treated in the same way, but they will appear on the newriders.com web site along with the content of the entire book, which is provided under the OPL.

Table of Contents

  1. Copyright
  2. About the Authors
  3. About the Technical Reviewers
  4. Acknowledgments
  5. Tell Us What You Think
  6. Introduction
  7. Apache-Specific Functions
    1. apache_lookup_uri
    2. apache_note
    3. ascii2ebcdic
    4. ebcdic2ascii
    5. getallheaders
    6. virtual
  8. Arbitrary-Precision Mathematics (BC) Functions
    1. bcadd
    2. bccomp
    3. bcdiv
    4. bcmod
    5. bcmul
    6. bcpow
    7. bcscale
    8. bcsqrt
    9. bcsub
  9. Array-Related Functions
    1. Overview
    2. Array Specifics
    3. array
    4. array_count_values
    5. array_flip
    6. array_intersect
    7. array_keys
    8. array_merge
    9. array_merge_recursive
    10. array_multisort
    11. array_pad
    12. array_pop
    13. array_push
    14. array_rand
    15. array_reverse
    16. array_shift
    17. array_slice
    18. array_splice
    19. array_sum
    20. array_unique
    21. array_unshift
    22. array_values
    23. array_walk
    24. arsort
    25. asort
    26. compact
    27. count
    28. current
    29. each
    30. end
    31. extract
    32. in_array
    33. key
    34. krsort
    35. ksort
    36. list
    37. natcasesort
    38. natsort
    39. next
    40. pos
    41. prev
    42. range
    43. reset
    44. rsort
    45. shuffle
    46. sizeof
    47. sort
    48. uasort
    49. uksort
    50. usort
  10. Calendar Functions
    1. easter_date
    2. easter_days
    3. frenchtojd
    4. gregoriantojd
    5. jddayofweek
    6. jdmonthname
    7. jdtofrench
    8. jdtogregorian
    9. jdtojewish
    10. jdtojulian
    11. jdtounix
    12. jewishtojd
    13. juliantojd
    14. unixtojd
  11. CCVS Functions
    1. CCVS Error Strings
    2. CCVS Status Strings
    3. ccvs_add
    4. ccvs_auth
    5. ccvs_command
    6. ccvs_count
    7. ccvs_delete
    8. ccvs_done
    9. ccvs_init
    10. ccvs_lookup
    11. ccvs_new
    12. ccvs_report
    13. ccvs_return
    14. ccvs_reverse
    15. ccvs_sale
    16. ccvs_status
    17. ccvs_textvalue
    18. ccvs_void
  12. Class and Object Functions
    1. call_user_method
    2. class_exists
    3. get_class
    4. get_class_methods
    5. get_class_vars
    6. get_declared_classes
    7. get_object_vars
    8. get_parent_class
    9. is_subclass_of
    10. method_exists
  13. COM Functions
    1. com_get
    2. com_invoke
    3. com_load
    4. com_propget
    5. com_propput
    6. com_propset
    7. com_set
    8. new COM
  14. Connection-Handling Functions
    1. Overview
    2. Connection-Handling Constants
    3. php.ini Directives Related to the Connection-Handling Functions
    4. Installing Connection-Handling Support
    5. connection_aborted
    6. connection_status
    7. connection_timeout
    8. ignore_user_abort
  15. cURL Library Functions
    1. curl_close
    2. curl_errno
    3. curl_error
    4. curl_exec
    5. curl_getinfo
    6. curl_init
    7. curl_setopt
    8. curl_version
  16. Date and Time Functions
    1. checkdate
    2. date
    3. getdate
    4. gettimeofday
    5. gmdate
    6. gmmktime
    7. gmstrftime
    8. localtime
    9. microtime
    10. mktime
    11. strftime
    12. strtotime
    13. time
  17. Directory Functions
    1. chdir
    2. closedir
    3. dir
    4. getcwd
    5. opendir
    6. readdir
    7. rewinddir
  18. Error-Handling Functions
    1. Good Error-Handling Practices
    2. error_log
    3. error_reporting
    4. restore_error_handler
    5. set_error_handler
    6. trigger_error
    7. user_error
  19. Filesystem Functions
    1. Overview
    2. Configuring the Filesystem Functions
    3. Installing Filesystem Support
    4. Additional Information
    5. chgrp
    6. chmod
    7. chown
    8. clearstatcache
    9. copy
    10. diskfreespace
    11. fclose
    12. feof
    13. fgetc
    14. fgetcsv
    15. fgets
    16. fgetss
    17. file
    18. fileatime
    19. filectime
    20. filegroup
    21. fileinode
    22. filemtime
    23. fileowner
    24. fileperms
    25. filesize
    26. filetype
    27. file_exists
    28. flock
    29. fopen
    30. fpassthru
    31. fputs
    32. fread
    33. fseek
    34. ftell
    35. fwrite
    36. getlastmod
    37. getmyinode
    38. is_dir
    39. is_executable
    40. is_file
    41. is_link
    42. is_readable
    43. is_writeable
    44. link
    45. linkinfo
    46. lstat
    47. mkdir
    48. pclose
    49. popen
    50. readfile
    51. readlink
    52. rename
    53. rewind
    54. rmdir
    55. set_file_buffer
    56. stat
    57. symlink
    58. tempnam
    59. touch
    60. umask
    61. uniqid
    62. unlink
  20. Function-Handling Functions
    1. call_user_func_array
    2. call_user_func
    3. create_function
    4. func_get_arg
    5. func_get_args
    6. func_num_args
    7. function_exists
    8. get_defined_functions
    9. register_shutdown_function
  21. HTTP-Related Functions
    1. header
    2. headers_sent
    3. setcookie
  22. Java Functions
    1. new Java
    2. java_last_exception_get
    3. java_last_exception_clear
  23. LDAP Functions
    1. Overview
    2. ldap_8859_to_t61
    3. ldap_add
    4. ldap_bind
    5. ldap_close
    6. ldap_connect
    7. ldap_compare
    8. ldap_count_entries
    9. ldap_delete
    10. ldap_dn2ufn
    11. ldap_err2str
    12. ldap_errno
    13. ldap_error
    14. ldap_explode_dn
    15. ldap_first_attribute
    16. ldap_first_entry
    17. ldap_free_entry
    18. ldap_free_result
    19. ldap_get_attributes
    20. ldap_get_dn
    21. ldap_get_entries
    22. ldap_get_values
    23. ldap_get_values_len
    24. ldap_list
    25. ldap_modify
    26. ldap_mod_add
    27. ldap_mod_del
    28. ldap_mod_replace
    29. ldap_next_attribute
    30. ldap_next_entry
    31. ldap_read
    32. ldap_t61_to_8859
    33. ldap_search
    34. ldap_unbind
  24. Mail Functions
    1. ezmlm_hash
    2. mail
  25. Mathematical Functions
    1. Overview
    2. Named Constants
    3. abs
    4. acos
    5. asin
    6. atan
    7. atan2
    8. base_convert
    9. bindec
    10. ceil
    11. cos
    12. decbin
    13. dechex
    14. decoct
    15. deg2rad
    16. exp
    17. floor
    18. getrandmax
    19. hexdec
    20. log
    21. log10
    22. max
    23. min
    24. mt_getrandmax
    25. mt_rand
    26. mt_srand
    27. number_format
    28. octdec
    29. pi
    30. pow
    31. rad2deg
    32. rand
    33. round
    34. sin
    35. sqrt
    36. srand
    37. tan
  26. mhash Functions
    1. mhash
    2. mhash_count
    3. mhash_get_block_size
    4. mhash_get_hash_name
    5. mhash_keygen_s2k
  27. Miscellaneous Functions
    1. Overview
    2. Configuring the Miscellaneous Functions
    3. Installing Miscellaneous Function Support
    4. define
    5. defined
    6. die
    7. eval
    8. exit
    9. get_browser
    10. highlight_file
    11. highlight_string
    12. iptcparse
    13. leak
    14. show_source
    15. sleep
    16. usleep
  28. MySQL Functions
    1. Overview
    2. How the MySQL Functions Work
    3. Notes on the Examples
    4. Configuring MySQL
    5. Installing MySQL Support
    6. Additional Information
    7. mysql
    8. mysql_affected_rows
    9. mysql_change_user
    10. mysql_close
    11. mysql_connect
    12. mysql_create_db
    13. mysql_createdb
    14. mysql_data_seek
    15. mysql_db_name
    16. mysql_db_query
    17. mysql_dbname
    18. mysql_drop_db
    19. mysql_dropdb
    20. mysql_errno
    21. mysql_error
    22. mysql_escape_string
    23. mysql_fetch_array
    24. mysql_fetch_assoc
    25. mysql_fetch_field
    26. mysql_fetch_lengths
    27. mysql_fetch_object
    28. mysql_fetch_row
    29. mysql_field_flags
    30. mysql_field_len
    31. mysql_field_name
    32. mysql_field_seek
    33. mysql_field_table
    34. mysql_field_type
    35. mysql_fieldname
    36. mysql_fieldtable
    37. mysql_fieldlen
    38. mysql_fieldtype
    39. mysql_fieldflags
    40. mysql_free_result
    41. mysql_freeresult
    42. mysql_insert_id
    43. mysql_list_dbs
    44. mysql_list_fields
    45. mysql_list_tables
    46. mysql_listdbs
    47. mysql_listfields
    48. mysql_listtables
    49. mysql_num_fields
    50. mysql_num_rows
    51. mysql_numfields
    52. mysql_numrows
    53. mysql_pconnect
    54. mysql_query
    55. mysql_result
    56. mysql_select_db
    57. mysql_selectdb
    58. mysql_tablename
  29. Networking Functions
    1. checkdnsrr
    2. debugger_off
    3. debugger_on
    4. fsockopen
    5. gethostbyaddr
    6. gethostbyname
    7. gethostbynamel
    8. getmxrr
    9. getprotobyname
    10. getprotobynumber
    11. getservbyname
    12. getservbyport
    13. ip2long
    14. long2ip
    15. pfsockopen
    16. socket_get_status
    17. socket_set_blocking
    18. socket_set_timeout
  30. ODBC Functions
    1. odbc_autocommit
    2. odbc_binmode
    3. odbc_close
    4. odbc_close_all
    5. odbc_columnprivileges
    6. odbc_columns
    7. odbc_commit
    8. odbc_connect
    9. odbc_cursor
    10. odbc_do
    11. odbc_error
    12. odbc_errormsg
    13. odbc_exec
    14. odbc_execute
    15. odbc_fetch_array
    16. odbc_fetch_into
    17. odbc_fetch_object
    18. odbc_fetch_row
    19. odbc_field_len
    20. odbc_field_name
    21. odbc_field_num
    22. odbc_field_precision
    23. odbc_field_scale
    24. odbc_field_type
    25. odbc_foreignkeys
    26. odbc_free_result
    27. odbc_gettypeinfo
    28. odbc_longreadlen
    29. odbc_num_fields
    30. odbc_num_rows
    31. odbc_pconnect
    32. odbc_prepare
    33. odbc_primarykeys
    34. odbc_procedurecolumns
    35. odbc_procedures
    36. odbc_result
    37. odbc_result_all
    38. odbc_rollback
    39. odbc_setoption
    40. odbc_specialcolumns
    41. odbc_statistics
    42. odbc_tableprivileges
    43. odbc_tables
  31. Pack and Unpack Functions
    1. pack
    2. unpack
  32. PHP Options and Information Functions
    1. assert
    2. assert_options
    3. dl
    4. extension_loaded
    5. getenv
    6. get_cfg_var
    7. get_current_user
    8. get_extension_funcs
    9. get_included_files
    10. get_loaded_extensions
    11. get_magic_quotes_gpc
    12. get_magic_quotes_runtime
    13. get_required_files
    14. getlastmod
    15. getmyinode
    16. getmypid
    17. getmyuid
    18. getrusage
    19. ini_alter
    20. ini_get
    21. ini_restore
    22. ini_set
    23. parse_ini_file
    24. phpcredits
    25. phpinfo
    26. phpversion
    27. php_logo_guid
    28. php_sapi_name
    29. php_uname
    30. putenv
    31. set_magic_quotes_runtime
    32. set_time_limit
    33. zend_logo_guid
    34. zend_version
  33. Program Execution Functions
    1. Overview
    2. How the Program Execution Functions Work
    3. escapeshellarg
    4. escapeshellcmd
    5. exec
    6. passthru
    7. system
  34. Pspell Functions
    1. pspell_add_to_personal
    2. pspell_add_to_session
    3. pspell_check
    4. pspell_clear_session
    5. pspell_config_create
    6. pspell_config_ignore
    7. pspell_config_mode
    8. pspell_config_personal
    9. pspell_config_repl
    10. pspell_config_runtogether
    11. pspell_config_save_repl
    12. pspell_new
    13. pspell_new_config
    14. pspell_new_personal
    15. pspell_save_wordlist
    16. pspell_store_replacement
    17. pspell_suggest
  35. Regular Expression Functions
    1. POSIX Extended Regular Expression Functions
    2. ereg
    3. eregi
    4. ereg_replace
    5. eregi_replace
    6. split
    7. spliti
    8. Perl-Compatible Regular Expression Functions
    9. Pattern Modifiers
    10. preg_grep
    11. preg_match
    12. preg_match_all
    13. preg_quote
    14. preg_replace
    15. preg_split
  36. Semaphore and Shared Memory Functions
    1. Overview
    2. sem_acquire
    3. sem_get
    4. sem_release
    5. shm_attach
    6. shm_detach
    7. shm_get_var
    8. shm_put_var
    9. shm_remove
    10. shm_remove_var
    11. shmop_close
    12. shmop_delete
    13. shmop_open
    14. shmop_read
    15. shmop_size
    16. shmop_write
  37. Session-Management Functions
    1. session_cache_limiter
    2. session_decode
    3. session_destroy
    4. session_encode
    5. session_get_cookie_params
    6. session_id
    7. session_is_registered
    8. session_module_name
    9. session_name
    10. session_register
    11. session_save_path
    12. session_set_cookie_params
    13. session_set_save_handler
    14. session_start
    15. session_unregister
    16. session_unset
  38. String Functions
    1. Overview
    2. Using the String Functions
    3. Configuring the String Functions
    4. Installing String Function Support
    5. addcslashes
    6. addslashes
    7. bin2hex
    8. chop
    9. chr
    10. chunk_split
    11. convert_cyr_string
    12. count_chars
    13. crc32
    14. crypt
    15. echo
    16. explode
    17. get_meta_tags
    18. hebrev
    19. hebrevc
    20. implode
    21. join
    22. levenshtein
    23. ltrim
    24. md5
    25. metaphone
    26. nl2br
    27. ord
    28. parse_str
    29. print
    30. printf
    31. quoted_printable_decode
    32. quotemeta
    33. rtrim
    34. sscanf
    35. setlocale
    36. similar_text
    37. soundex
    38. sprintf
    39. strchr
    40. strcspn
    41. strip_tags
    42. stripcslashes
    43. stripslashes
    44. stristr
    45. strnatcmp
    46. strnatcasecmp
    47. str_pad
    48. strpos
    49. strrchr
    50. str_repeat
    51. strrev
    52. strrpos
    53. strspn
    54. strstr
    55. strtok
    56. strtolower
    57. strtoupper
    58. str_replace
    59. strtr
    60. substr
    61. substr_count
    62. substr_replace
    63. trim
    64. ucfirst
    65. ucwords
    66. wordwrap
  39. Syslog Functions
    1. closelog
    2. define_syslog_variables
    3. openlog
    4. syslog
  40. Tick Functions
    1. Overview
    2. How Ticks Work
    3. Tick Functions
    4. register_tick_function
    5. unregister_tick_function
  41. URL Functions
    1. base64_decode
    2. base64_encode
    3. parse_url
    4. rawurldecode
    5. rawurlencode
    6. urldecode
    7. urlencode
  42. Variable-Related Functions
    1. Overview
    2. Configuring Variable-Related Functions
    3. Installing Variable-Related Functions Support
    4. Additional Information
    5. doubleval
    6. empty
    7. get_defined_vars
    8. get_resource_type
    9. gettype
    10. intval
    11. is_array
    12. is_bool
    13. is_double
    14. is_float
    15. is_int
    16. is_integer
    17. is_long
    18. is_null
    19. is_numeric
    20. is_object
    21. is_real
    22. is_resource
    23. is_scalar
    24. is_string
    25. isset
    26. print_r
    27. serialize
    28. settype
    29. strval
    30. unserialize
    31. unset
    32. var_dump
  43. WDDX Functions
    1. wddx_add_vars
    2. wddx_deserialize
    3. wddx_packet_end
    4. wddx_packet_start
    5. wddx_serialize_value
    6. wddx_serialize_vars
    7. wddx_unserialize
  44. XML Functions
    1. Overview
    2. xml_error_string
    3. xml_get_current_byte_index
    4. xml_get_current_column_number
    5. xml_get_current_line_number
    6. xml_get_error_code
    7. xml_parse
    8. xml_parser_create
    9. xml_parser_free
    10. xml_parser_get_option
    11. xml_parser_set_option
    12. xml_parse_into_struct
    13. xml_set_character_data_handler
    14. xml_set_default_handler
    15. xml_set_element_handler
    16. xml_set_external_entity_ref_handler
    17. xml_set_notation_decl_handler
    18. xml_set_processing_instruction_handler
    19. xml_set_unparsed_entity_decl_handler
    20. xml_set_object