PHP in easy steps, 4th edition
eBook - ePub

PHP in easy steps, 4th edition

Updated for PHP 8

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

PHP in easy steps, 4th edition

Updated for PHP 8

About this book

PHP in easy steps, 4th edition demonstrates every aspect of the language you'll need to produce professional web programming results. Its examples provide clear syntax-highlighted code, which is freely downloadable, showing PHP language basics including variables, arrays, logic, looping, functions and classes.

  • Install a free web server and the PHP interpreter to create an environment in which you can produce your own data-driven web pages.
  • Write PHP server-side scripts; master PHP operators and control structures; process HTML form data; get cookies and session data; access Web Services APIs over HTTP... and much more!

PHP in easy steps, 4th edition is ideal for PHP newbies who want to quickly learn the fundamentals of server-side programming with PHP and create interactive web pages. Also, useful for PHP pros who want to grasp the new PHP 8 features and achieve optimum performance!

Updated for PHP 8.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access PHP in easy steps, 4th edition by Mike McGrath in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in PHP. We have over one million books available in our catalogue for you to explore.
1
Getting started
Welcome to the exciting world of the interactive web with PHP. This chapter demonstrates how to create a dynamic development environment with a web server and the PHP engine.
Introducing PHP
Installing the Abyss server
Installing the PHP engine
Integrating Abyss and PHP
Embedding PHP script code
Scripting by the rules
Improving performance
Enabling JIT compilation
Summary
Introducing PHP
The most appealing modern websites provide a customized user experience by dynamically responding to some current conditions – user name, time of day, latest blog, shopping cart contents, etc. Many of these dynamic websites are created using PHP.
image
This is the official logo of the PHP project – the official online home of PHP can be found at php.net
What is PHP?
PHP is a widely-used general purpose scripting language that is especially suited for web development and can be embedded into HTML. It was created by programmer Rasmus Lerdorf, as a set of scripts to maintain his website that he released as ā€œPersonal Home Page Tools (PHP Tools) version 1.0ā€ on June 8, 1995.
The tools were extended in the version 2 release of 1997, and the name changed to become a recursive acronym ā€œPHP: Hypertext Preprocessorā€ in version 3 the following year. Performance, reliability and extensibility were improved in 2000 with the release of PHP4, which was powered by the Zend engine virtual machine.
Subsequently, PHP5 was released in 2004 powered by the new Zend II engine and produced as free software by the PHP group. A planned experimental version PHP6, which intended to introduce native Unicode support throughout PHP, was abandoned but PHP7 was released in 2015. PHP8 was released in 2020 and offers ā€œJust In Timeā€ (JIT) compilation for improved performance. Today, PHP is installed on over 20 million websites and 1 million web servers.
Why is PHP popular?
•PHP is extremely simple for a newcomer, but offers many advanced features for a professional programmer.
•PHP code is enclosed in special start and end processing tags that allow you to jump into and out of ā€œPHP modeā€, to implement instructions within an HTML document.
•PHP code is executed on the server (ā€œserver-sideā€), unlike JavaScript code that is executed in the browser (ā€œclient-sideā€). The client receives the results of running the script without knowing what the underlying code was. Recently, server-side has become known as ā€œThe Cloudā€.
image
This is the ā€œelePHPantā€ – the mascot of the PHP project, designed by Vincent Pontier.
Understanding The Cloud
Whenever a user asks to view a web page in their browser, it requests the...

Table of contents

  1. Cover
  2. Title
  3. Copyright
  4. Contents
  5. 1 Getting started
  6. 2 Storing values
  7. 3 Performing operations
  8. 4 Testing conditions
  9. 5 Employing functions
  10. 6 Manipulating strings
  11. 7 Building classes
  12. 8 Handling files
  13. 9 Producing forms
  14. 10 Preserving data
  15. 11 Adding Web Services
  16. Backcover