Getting Starting With PHP 7.0

Introduction

I am starting to make a series of articles on PHP 7.0. This is the latest release, and today I will give you a brief description about PHP for beginners. I will start with the history of PHP and move further with some more features with some different methods.

What You Need To Follow This Article

  • No previous experience of PHP programming.
  • Good knowledge of HTML.
  • Knowledge of JavaScript is helpful, but not essential.

What You Need

  • Remote Server
  • Local testing environments

Why Local Server

  • No need to constantly upload scripts for testing.
  • Don’t expose your mistakes in public.

What You Need For Coding

  • Script Editor

    • PHP Syntax Checking
    • PHP Syntax Coloring
    • PHP Code Hints
    • Line Numbering
    • A “Balance Braces”feature

Operating System

  • PHP is platform neutral.
  • It runs on Linux, Mac and Windows.

PHP Version

  • This article is based on PHP 7.0
  • PHP 6 never publicly released
  • Recommended minimum PHP version PHP 5.5
  • Official support for PHP 5.4 ended in September 2015
  • Most code in this article will run on PHP 5.4

Revised

  • Original version was based on PHP 5.3.
  • Updated to PHP 7.
  • Backward compatible with PHP 5.4 or later.
  • No coverage of installing a local PHP server.

Improvements

  • Removed discussion of “magic quotes”.
  • Simpler array syntax.
  • Clearer explanations.
  • New chapter on interpreting error messages.
  • Challenges and situation.

What PHP Can Do

  • Process and email contact forms.
  • Upload files from online forms.
  • Generate thumbnails from larger images.
  • Watermark images.
  • Read and write files.
  • Do date and time calculations.
  • Change content depending on date or time.
  • Communicate with database.
  • And much, much more.

How PHP Works

PHP

Common features in most PHP scripts:

  • Variables
  • Array
  • Loops
  • Conditional function
  • Function

Using PHP

  • Using file extension .PHP

Tags PHP

  • Opening tag : <?PHP
  • Don’t use <? as the opening tag
  • Closing tag is optional

Using PHP

  • Storage pages inside the server root folder names:
    • Htdocs
    • www
    • wwwroot
    • public-html

Viewing PHP Files Locally

  • Don’t double click local files to view form.
  • Make sure your local web server is running.
  • Always view the page using a URL.
Read more articles on PHP:

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now