This tutorial covers: PHP basics such as: tags, comments, echo, print, echo shortcut and difference between echo and print and why to use PHP?
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 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.
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.
In this tutorial we'll discuss the most fundamental parts of PHP programming language: variable assignment, expressions and operators.
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.
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.
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.