Programming PHP

Creating Dynamic Web Pages
 
 
O'Reilly (Verlag)
  • erschienen am 12. März 2020
  • |
  • 544 Seiten
 
E-Book | ePUB mit Adobe-DRM | Systemvoraussetzungen
978-1-4920-5408-5 (ISBN)
 
Why is PHP the most widely used programming language on the web? This updated edition teaches everything you need to know to create effective web applications using the latest features in PHP 7.4. Youll start with the big picture and then dive into language syntax, programming techniques, and other details, using examples that illustrate both correct usage and common idioms. If you have a working knowledge of HTML, authors Kevin Tatroe and Peter MacIntyre provide many style tips and practical programming advice in a clear and concise manner to help you become a top-notch PHP programmer.Understand whats possible when you use PHP programsLearn language fundamentals, including data types, variables, operators, and flow control statementsExplore functions, strings, arrays, and objectsApply common web application techniques, such as form processing, data validation, session tracking, and cookiesInteract with relational databases like MySQL or NoSQL databases such as MongoDBGenerate dynamic images, create PDF files, and parse XML filesLearn secure scripts, error handling, performance tuning, and other advanced topicsGet a quick reference to PHP core functions and standard extensions
  • Englisch
  • Sebastopol
  • |
  • USA
  • 3,59 MB
978-1-4920-5408-5 (9781492054085)
weitere Ausgaben werden ermittelt
  • Intro
  • Foreword
  • Preface
  • Audience
  • Assumptions This Book Makes
  • Contents of This Book
  • Conventions Used in This Book
  • O'Reilly Online Learning
  • How to Contact Us
  • Acknowledgments
  • Kevin Tatroe
  • Peter MacIntyre
  • 1. Introduction to PHP
  • What Does PHP Do?
  • A Brief History of PHP
  • The Evolution of PHP
  • The Widespread Use of PHP
  • Installing PHP
  • A Walk Through PHP
  • Configuration Page
  • Forms
  • Databases
  • Graphics
  • What's Next
  • 2. Language Basics
  • Lexical Structure
  • Case Sensitivity
  • Statements and Semicolons
  • Whitespace and Line Breaks
  • Comments
  • Shell-style comments
  • C++ comments
  • C comments
  • Literals
  • Identifiers
  • Variable names
  • Function names
  • Class names
  • Constants
  • Keywords
  • Data Types
  • Integers
  • Floating-Point Numbers
  • Strings
  • Booleans
  • Arrays
  • Objects
  • Resources
  • Callbacks
  • NULL
  • Variables
  • Variable Variables
  • Variable References
  • Variable Scope
  • Local scope
  • Global scope
  • Static variables
  • Function parameters
  • Garbage Collection
  • Expressions and Operators
  • Number of Operands
  • Operator Precedence
  • Operator Associativity
  • Implicit Casting
  • Arithmetic Operators
  • String Concatenation Operator
  • Auto-Increment and Auto-Decrement Operators
  • Comparison Operators
  • Bitwise Operators
  • Logical Operators
  • Casting Operators
  • Assignment Operators
  • Assignment
  • Assignment with operation
  • Miscellaneous Operators
  • Flow-Control Statements
  • if
  • switch
  • while
  • for
  • foreach
  • try...catch
  • declare
  • exit and return
  • goto
  • Including Code
  • Embedding PHP in Web Pages
  • Standard (XML) Style
  • SGML Style
  • Echoing Content Directly
  • What's Next
  • 3. Functions
  • Calling a Function
  • Defining a Function
  • Variable Scope
  • Global Variables
  • Static Variables
  • Function Parameters
  • Passing Parameters by Value
  • Passing Parameters by Reference
  • Default Parameters
  • Variable Parameters
  • Missing Parameters
  • Type Hinting
  • Return Values
  • Variable Functions
  • Anonymous Functions
  • What's Next
  • 4. Strings
  • Quoting String Constants
  • Variable Interpolation
  • Single-Quoted Strings
  • Double-Quoted Strings
  • Here Documents
  • Printing Strings
  • echo
  • print()
  • printf()
  • Format modifiers
  • Type specifiers
  • print_r() and var_dump()
  • Accessing Individual Characters
  • Cleaning Strings
  • Removing Whitespace
  • Changing Case
  • Encoding and Escaping
  • HTML
  • Entity-quoting all special characters
  • Entity-quoting only HTML syntax characters
  • Removing HTML tags
  • Extracting meta tags
  • URLs
  • RFC 3986 encoding and decoding
  • Query-string encoding
  • SQL
  • C-String Encoding
  • Comparing Strings
  • Exact Comparisons
  • Approximate Equality
  • Manipulating and Searching Strings
  • Substrings
  • Miscellaneous String Functions
  • Decomposing a String
  • Exploding and imploding
  • Tokenizing
  • sscanf()
  • String-Searching Functions
  • Searches returning position
  • Searches returning rest of string
  • Searches using masks
  • Decomposing URLs
  • Regular Expressions
  • The Basics
  • Character Classes
  • Alternatives
  • Repeating Sequences
  • Subpatterns
  • Delimiters
  • Match Behavior
  • Character Classes
  • Anchors
  • Quantifiers and Greed
  • Noncapturing Groups
  • Backreferences
  • Trailing Options
  • Inline Options
  • Lookahead and Lookbehind
  • Cut
  • Conditional Expressions
  • Functions
  • Matching
  • Replacing
  • Splitting
  • Filtering an array with a regular expression
  • Quoting for regular expressions
  • Differences from Perl Regular Expressions
  • What's Next
  • 5. Arrays
  • Indexed Versus Associative Arrays
  • Identifying Elements of an Array
  • Storing Data in Arrays
  • Appending Values to an Array
  • Assigning a Range of Values
  • Getting the Size of an Array
  • Padding an Array
  • Multidimensional Arrays
  • Extracting Multiple Values
  • Slicing an Array
  • Splitting an Array into Chunks
  • Keys and Values
  • Checking Whether an Element Exists
  • Removing and Inserting Elements in an Array
  • Converting Between Arrays and Variables
  • Creating Variables from an Array
  • Creating an Array from Variables
  • Traversing Arrays
  • The foreach Construct
  • The Iterator Functions
  • Using a for Loop
  • Calling a Function for Each Array Element
  • Reducing an Array
  • Searching for Values
  • Sorting
  • Sorting One Array at a Time
  • Natural-Order Sorting
  • Sorting Multiple Arrays at Once
  • Reversing Arrays
  • Randomizing Order
  • Acting on Entire Arrays
  • Calculating the Sum of an Array
  • Merging Two Arrays
  • Calculating the Difference Between Two Arrays
  • Filtering Elements from an Array
  • Using Arrays to Implement Data Types
  • Sets
  • Stacks
  • Implementing the Iterator Interface
  • What's Next
  • 6. Objects
  • Objects
  • Terminology
  • Creating an Object
  • Accessing Properties and Methods
  • Declaring a Class
  • Declaring Methods
  • Declaring Properties
  • Declaring Constants
  • Inheritance
  • Interfaces
  • Traits
  • Abstract Methods
  • Constructors
  • Destructors
  • Anonymous Classes
  • Introspection
  • Examining Classes
  • Examining an Object
  • Sample Introspection Program
  • Serialization
  • What's Next
  • 7. Dates and Times
  • What's Next
  • 8. Web Techniques
  • HTTP Basics
  • Variables
  • Server Information
  • Processing Forms
  • Methods
  • Parameters
  • Self-Processing Pages
  • Sticky Forms
  • Multivalued Parameters
  • Sticky Multivalued Parameters
  • File Uploads
  • Form Validation
  • Setting Response Headers
  • Different Content Types
  • Redirections
  • Expiration
  • Authentication
  • Maintaining State
  • Cookies
  • Sessions
  • Session basics
  • Alternatives to cookies
  • Custom storage
  • Combining Cookies and Sessions
  • SSL
  • What's Next
  • 9. Databases
  • Using PHP to Access a Database
  • Relational Databases and SQL
  • PHP Data Objects
  • Making a connection
  • Interacting with the database
  • Using PDO and prepared statements
  • Handling transactions
  • Debugging statements
  • MySQLi Object Interface
  • Retrieving Data for Display
  • SQLite
  • Direct File-Level Manipulation
  • MongoDB
  • Retrieving Data
  • Inserting More Complex Data
  • What's Next
  • 10. Graphics
  • Embedding an Image in a Page
  • Basic Graphics Concepts
  • Creating and Drawing Images
  • The Structure of a Graphics Program
  • Changing the Output Format
  • Testing for Supported Image Formats
  • Reading an Existing File
  • Basic Drawing Functions
  • Images with Text
  • Fonts
  • TrueType Fonts
  • Dynamically Generated Buttons
  • Caching the Dynamically Generated Buttons
  • A Faster Cache
  • Scaling Images
  • Color Handling
  • Using the Alpha Channel
  • Identifying Colors
  • True Color Indexes
  • Text Representation of an Image
  • What's Next
  • 11. PDF
  • PDF Extensions
  • Documents and Pages
  • A Simple Example
  • Initializing the Document
  • Outputting Basic Text Cells
  • Text
  • Coordinates
  • Text Attributes
  • Page Headers, Footers, and Class Extension
  • Images and Links
  • Tables and Data
  • What's Next
  • 12. XML
  • Lightning Guide to XML
  • Generating XML
  • Parsing XML
  • Element Handlers
  • Character Data Handler
  • Processing Instructions
  • Entity Handlers
  • External entities
  • Unparsed entities
  • Default Handler
  • Options
  • Character encoding
  • Case folding
  • Skipping whitespace-only
  • Truncating tag names
  • Using the Parser
  • Errors
  • Methods as Handlers
  • Sample Parsing Application
  • Parsing XML with the DOM
  • Parsing XML with SimpleXML
  • Transforming XML with XSLT
  • What's Next
  • 13. JSON
  • Using JSON
  • Serializing PHP Objects
  • Options
  • What's Next
  • 14. Security
  • Safeguards
  • Filtering Input
  • Escaping Output Data
  • Security Vulnerabilities
  • Cross-Site Scripting
  • SQL Injection
  • Filename Vulnerabilities
  • Check for relative paths
  • Session Fixation
  • File Upload Traps
  • Distrust browser-supplied filenames
  • Beware of filling your filesystem
  • Account for EGPCS settings
  • Unauthorized File Access
  • Restrict filesystem access to a specific directory
  • Get permissions right the first time
  • Don't use files
  • Protect session files
  • Conceal PHP libraries
  • PHP Code Issues
  • Shell Command Weaknesses
  • Data Encryption Concerns
  • Further Resources
  • Security Recap
  • What's Next
  • 15. Application Techniques
  • Code Libraries
  • Templating Systems
  • Handling Output
  • Output Buffering
  • Output Compression
  • Performance Tuning
  • Benchmarking
  • Profiling
  • Optimizing Execution Time
  • Optimizing Memory Requirements
  • Reverse Proxies and Replication
  • Reverse-proxy caches
  • Load balancing and redirection
  • MySQL replication
  • Putting it all together
  • What's Next
  • 16. Web Services
  • REST Clients
  • Responses
  • Retrieving Resources
  • Updating Resources
  • Creating Resources
  • Deleting Resources
  • XML-RPC
  • Servers
  • Clients
  • What's Next
  • 17. Debugging PHP
  • The Development Environment
  • The Staging Environment
  • The Production Environment
  • php.ini Settings
  • Error Handling
  • Error Reporting
  • Exceptions
  • Error Suppression
  • Triggering Errors
  • Defining Error Handlers
  • Logging in error handlers
  • Output buffering in error handlers
  • Manual Debugging
  • Error Logs
  • IDE Debugging
  • Additional Debugging Techniques
  • What's Next
  • 18. PHP on Disparate Platforms
  • Writing Portable Code for Windows and Unix
  • Determining the Platform
  • Handling Paths Across Platforms
  • Navigating the Server Environment
  • Sending Mail
  • End-of-Line Handling
  • End-of-File Handling
  • Using External Commands
  • Accessing Platform-Specific Extensions
  • Interfacing with COM
  • Background
  • PHP Functions
  • API Specifications
  • Function Reference
  • PHP Functions by Category
  • Arrays
  • Classes and Objects
  • Data Filtering
  • Date and Time
  • Directories
  • Errors and Logging
  • Filesystem
  • Functions
  • Mail
  • Math
  • Miscellaneous Functions
  • Network
  • Output Buffering
  • PHP Language Tokenizer
  • PHP Options/Info
  • Program Execution
  • Session Handling
  • Streams
  • Strings
  • URLs
  • Variables
  • Zlib
  • Alphabetical Listing of PHP Functions
  • abs
  • acos
  • acosh
  • addcslashes
  • addslashes
  • array_change_key_case
  • array_chunk
  • array_combine
  • array_count_values
  • array_diff
  • array_diff_assoc
  • array_diff_key
  • array_diff_uassoc
  • array_diff_ukey
  • array_fill
  • array_fill_keys
  • array_filter
  • array_flip
  • array_intersect
  • array_intersect_assoc
  • array_intersect_key
  • array_intersect_uassoc
  • array_intersect_ukey
  • array_key_exists
  • array_keys
  • array_map
  • array_merge
  • array_merge_recursive
  • array_multisort
  • array_pad
  • array_pop
  • array_product
  • array_push
  • array_rand
  • array_reduce
  • array_replace
  • array_replace_recursive
  • array_reverse
  • array_search
  • array_shift
  • array_slice
  • array_splice
  • array_sum
  • array_udiff
  • array_udiff_assoc
  • array_udiff_uassoc
  • array_uintersect
  • array_uintersect_assoc
  • array_uintersect_uassoc
  • array_unique
  • array_unshift
  • array_values
  • array_walk
  • array_walk_recursive
  • arsort
  • asin
  • asinh
  • asort
  • assert
  • assert_options
  • atan
  • atan2
  • atanh
  • base_convert
  • base64_decode
  • base64_encode
  • basename
  • bin2hex
  • bindec
  • call_user_func
  • call_user_func_array
  • ceil
  • chdir
  • checkdate
  • checkdnsrr
  • chgrp
  • chmod
  • chown
  • chr
  • chroot
  • chunk_split
  • class_alias
  • class_exists
  • class_implements
  • class_parents
  • clearstatcache
  • closedir
  • closelog
  • compact
  • connection_aborted
  • connection_status
  • constant
  • convert_cyr_string
  • convert_uudecode
  • convert_uuencode
  • copy
  • cos
  • cosh
  • count
  • count_chars
  • crc32
  • create_function
  • crypt
  • current
  • date
  • date_default_timezone_get
  • date_default_timezone_set
  • date_parse
  • date_parse_from_format
  • date_sun_info
  • date_sunrise
  • date_sunset
  • debug_backtrace
  • debug_print_backtrace
  • decbin
  • dechex
  • decoct
  • define
  • define_syslog_variables
  • defined
  • deflate_add
  • deflate_init
  • deg2rad
  • dir
  • dirname
  • disk_free_space
  • disk_total_space
  • each
  • echo
  • empty
  • end
  • error_clear_last
  • error_get_last
  • error_log
  • error_reporting
  • escapeshellarg
  • escapeshellcmd
  • exec
  • exp
  • explode
  • expm1
  • extension_loaded
  • extract
  • fclose
  • feof
  • fflush
  • fgetc
  • fgetcsv
  • fgets
  • fgetss
  • file
  • file_exists
  • fileatime
  • filectime
  • file_get_contents
  • filegroup
  • fileinode
  • filemtime
  • fileowner
  • fileperms
  • file_put_contents
  • filesize
  • filetype
  • filter_has_var
  • filter_id
  • filter_input
  • filter_input_array
  • filter_list
  • filter_var
  • filter_var_array
  • floatval
  • flock
  • floor
  • flush
  • fmod
  • fnmatch
  • fopen
  • forward_static_call
  • forward_static_call_array
  • fpassthru
  • fprintf
  • fputcsv
  • fread
  • fscanf
  • fseek
  • fsockopen
  • fstat
  • ftell
  • ftruncate
  • func_get_arg
  • func_get_args
  • func_num_args
  • function_exists
  • fwrite
  • gc_collect_cycles
  • gc_disable
  • gc_enable
  • gc_enabled
  • get_browser
  • get_called_class
  • get_cfg_var
  • get_class
  • get_class_methods
  • get_class_vars
  • get_current_user
  • get_declared_classes
  • get_declared_interfaces
  • get_declared_traits
  • get_defined_constants
  • get_defined_functions
  • get_defined_vars
  • get_extension_funcs
  • get_headers
  • get_html_translation_table
  • get_included_files
  • get_include_path
  • get_loaded_extensions
  • get_meta_tags
  • getmygid
  • getmyuid
  • get_object_vars
  • get_parent_class
  • get_resource_type
  • getcwd
  • getdate
  • getenv
  • gethostbyaddr
  • gethostbyname
  • gethostbynamel
  • gethostname
  • getlastmod
  • getmxrr
  • getmyinode
  • getmypid
  • getopt
  • getprotobyname
  • getprotobynumber
  • getrandmax
  • getrusage
  • getservbyname
  • getservbyport
  • gettimeofday
  • gettype
  • glob
  • gmdate
  • gmmktime
  • gmstrftime
  • hash
  • hash_algos
  • hash_file
  • header
  • header_remove
  • headers_list
  • headers_sent
  • hebrev
  • hex2bin
  • hexdec
  • highlight_file
  • highlight_string
  • hrtime
  • htmlentities
  • html_entity_decode
  • htmlspecialchars
  • htmlspecialchars_decode
  • http_build_query
  • hypot
  • idate
  • ignore_user_abort
  • implode
  • inet_ntop
  • inet_pton
  • in_array
  • ini_get
  • ini_get_all
  • ini_restore
  • ini_set
  • intdiv
  • interface_exists
  • intval
  • ip2long
  • is_a
  • is_array
  • is_bool
  • is_callable
  • is_countable
  • is_dir
  • is_executable
  • is_file
  • is_finite
  • is_float
  • is_infinite
  • is_int
  • is_iterable
  • is_link
  • is_nan
  • is_null
  • is_numeric
  • is_object
  • is_readable
  • is_resource
  • is_scalar
  • is_string
  • is_subclass_of
  • is_uploaded_file
  • is_writable
  • isset
  • json_decode
  • json_encode
  • key
  • krsort
  • ksort
  • lcfirst
  • lcg_value
  • lchgrp
  • lchown
  • levenshtein
  • link
  • linkinfo
  • list
  • localeconv
  • localtime
  • log
  • log10
  • log1p
  • long2ip
  • lstat
  • ltrim
  • mail
  • max
  • md5
  • md5_file
  • memory_get_peak_usage
  • memory_get_usage
  • metaphone
  • method_exists
  • microtime
  • min
  • mkdir
  • mktime
  • move_uploaded_file
  • mt_getrandmax
  • mt_rand
  • mt_srand
  • natcasesort
  • natsort
  • next
  • nl_langinfo
  • nl2br
  • number_format
  • ob_clean
  • ob_end_clean
  • ob_end_flush
  • ob_flush
  • ob_get_clean
  • ob_get_contents
  • ob_get_flush
  • ob_get_length
  • ob_get_level
  • ob_get_status
  • ob_gzhandler
  • ob_implicit_flush
  • ob_list_handlers
  • ob_start
  • octdec
  • opendir
  • openlog
  • ord
  • output_add_rewrite_var
  • output_reset_rewrite_vars
  • pack
  • parse_ini_file
  • parse_ini_string
  • parse_str
  • parse_url
  • passthru
  • pathinfo
  • pclose
  • pfsockopen
  • php_ini_loaded_file
  • php_ini_scanned_files
  • php_logo_guid
  • php_sapi_name
  • php_strip_whitespace
  • php_uname
  • phpcredits
  • phpinfo
  • phpversion
  • pi
  • popen
  • pow
  • prev
  • print_r
  • printf
  • proc_close
  • proc_get_status
  • proc_nice
  • proc_open
  • proc_terminate
  • property_exists
  • putenv
  • quoted_printable_decode
  • quoted_printable_encode
  • quotemeta
  • rad2deg
  • rand
  • random_bytes
  • random_int
  • range
  • rawurldecode
  • rawurlencode
  • readdir
  • readfile
  • readlink
  • realpath
  • realpath_cache_get
  • realpath_cache_size
  • register_shutdown_function
  • register_tick_function
  • rename
  • reset
  • restore_error_handler
  • restore_exception_handler
  • rewind
  • rewinddir
  • rmdir
  • round
  • rsort
  • rtrim
  • scandir
  • serialize
  • set_error_handler
  • set_exception_handler
  • set_include_path
  • set_time_limit
  • setcookie
  • setlocale
  • setrawcookie
  • settype
  • sha1
  • sha1_file
  • shell_exec
  • shuffle
  • similar_text
  • sin
  • sinh
  • sleep
  • sort
  • soundex
  • sprintf
  • sqrt
  • srand
  • sscanf
  • stat
  • str_getcsv
  • str_ireplace
  • str_pad
  • str_repeat
  • str_replace
  • str_rot13
  • str_shuffle
  • str_split
  • str_word_count
  • strcasecmp
  • strcmp
  • strcoll
  • strcspn
  • strftime
  • stripcslashes
  • stripslashes
  • strip_tags
  • stripos
  • stristr
  • strlen
  • strnatcasecmp
  • strnatcmp
  • strncasecmp
  • strncmp
  • strpbrk
  • strpos
  • strptime
  • strrchr
  • strrev
  • strripos
  • strrpos
  • strspn
  • strstr
  • strtok
  • strtolower
  • strtotime
  • strtoupper
  • strtr
  • strval
  • substr
  • substr_compare
  • substr_count
  • substr_replace
  • symlink
  • syslog
  • system
  • sys_getloadavg
  • sys_get_temp_dir
  • tan
  • tanh
  • tempnam
  • time
  • time_nanosleep
  • time_sleep_until
  • timezone_name_from_abbr
  • timezone_version_get
  • tmpfile
  • token_get_all
  • token_name
  • touch
  • trait_exists
  • trigger_error
  • trim
  • uasort
  • ucfirst
  • ucwords
  • uksort
  • umask
  • uniqid
  • unlink
  • unpack
  • unregister_tick_function
  • unserialize
  • unset
  • urldecode
  • urlencode
  • usleep
  • usort
  • var_dump
  • var_export
  • version_compare
  • vfprintf
  • vprintf
  • vsprintf
  • wordwrap
  • zend_thread_id
  • zend_version
  • Index
Schweitzer Klassifikation
DNB DDC Sachgruppen

Dateiformat: ePUB
Kopierschutz: Adobe-DRM (Digital Rights Management)

Systemvoraussetzungen:

Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).

Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions (siehe E-Book Hilfe).

E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)

Das Dateiformat ePUB ist sehr gut für Romane und Sachbücher geeignet - also für "fließenden" Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an. Mit Adobe-DRM wird hier ein "harter" Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.

Bitte beachten Sie bei der Verwendung der Lese-Software Adobe Digital Editions: wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!

Weitere Informationen finden Sie in unserer E-Book Hilfe.


Download (sofort verfügbar)

48,99 €
inkl. 5% MwSt.
Download / Einzel-Lizenz
ePUB mit Adobe-DRM
siehe Systemvoraussetzungen
E-Book bestellen