Tutorials covering PHP 5 and 7

In Dec 2015, PHP 7 was released, bringing numerous improvements and new features, such as: New Zend Engine, improved performance, reduced memory usage, abstract syntax tree, improved exception hierarchy, many fatal errors converted to exceptions, secure random number generator, removed old and unsupported SAPIs and extensions, the null coalescing operator, return and Scalar type declarations, anonymous classes, and many others.

Introducing PHP

This tutorial covers: PHP basics such as: tags, comments, echo, print, echo shortcut and difference between echo and print and why to use PHP?

PHP Development Environment

Learn how to test PHP scripts on your laptop or computer by installing PHP, Apache and MySQL. You'll also learn how to write a PHP script using a code editor or IDE.

Variables and data types

Variables in PHP are identified by a dollar sign ($) followed by the variable name. Variables don't need to be declared, and they have no type until they are assigned a value.

Constants

A constant is a variable with a value that cannot be changed by the script. Constants may not be redefined or undefined once they have been set. PHP provides two methods for creating constants: the const modifier and the define() function.

Variable Assignment, Operators and Expressions

In this tutorial we'll discuss the most fundamental parts of PHP programming language: variable assignment, expressions and operators.

Determine Variable Data Type

In PHP, you can initialize a variable with an integer value, add a float value to it, thereby turning it into a float, then join it onto a string value to produce a string.

Type Conversion

PHP provides several mechanisms to allow variables of one type to be considered as another type. Variables can be explicitly converted to another type with the settype, strval, intval, boolval and floatval functions.

Using namespaces in PHP

Namespaces help to avoid naming collisions between libraries and shared code. A namespace will encapsulate the codes (classes, functions and constants) inside it so that they don’t conflict if the same declared elsewhere.

Advertisement:
Advertisement: