PHP 5 Introduction

While classes and the entire concept of Object Oriented Programming (OOP) is the basis of lots of modern programming languages, PHP was built on the principles of functions instead.PHP scripts are executed on the server. Basic support for classes was first introduced in version 4 of PHP but then re-written for version 5, for a more complete OOP support. Today, PHP is definitely usable for working with classes, and while the PHP library still mainly consists of functions, classes are now being added for various purposes. However, the main purpose is of course to write and use your own classes, which is what we will look into during the next chapters.

What You Should Already Know

  • HTML
  • CSS
  • JavaScript
  • PHP is an amazing and popular language.It is also easy enough to be a beginner's first server side language.It is powerful enough to be at the core of the biggest blogging system on the web (WordPress)It is deep enough to run the largest social network (Facebook)

    What is PHP?

    PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.PHP files can contain text, HTML, CSS, JavaScript, and PHP code.PHP code are executed on the server, and the result is returned to the browser as plain HTML PHP files have extension ".php"

    What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server, generating HTML which is then sent to the client. The client would receive the results of running that script, but would not know what the underlying code was. You can even configure your web server to process all your HTML files with PHP, and then there's really no way that users can tell what you have up your sleeve.

    The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer. Don't be afraid reading the long list of PHP's features.