PHP do-while loop

The PHP do-while loop is guaranteed to run at least once. It executes the code at least one time always because the condition is checked after executing the code. The … Read more

PHP – Increment date by day

You can increment date by day with the help of strtotime() php function. In following example we are increment specified date by 1 day (next day date). Here “1 day” … Read more

PHP While Loop

The while statement executes the statement(s) repeatedly as long as the condition is true. The condition is checked every time at the beginning of the loop. Once the condition gets FALSE, it … Read more

PHP For Loop

Loops in PHP are used to perform a task repeatedly. PHP for loop can be used to traverse set of code for the specified number of times. It is typically … Read more

PHP Constants

Constants are similar to the variable except once they defined, they can never be undefined or changed. A constant value cannot change during the execution of the script. Once a … Read more

PHP Data Types

Data Types define the type of data a variable can store. PHP supports 8 primitive data types that can be categorized further in 3 types. Scalar Types (predefined) Compound Types … Read more

PHP Variables

PHP variable is declared using a $ sign followed by the variable name. As PHP is a loosely typed language, so you do not need to declare the data types of the … Read more

PHP Comments

Comments are not executed as a part of the program. In this chapter you will learn about “How to write comments in PHP?”. Comments are generally used for documenting purpose. … Read more

PHP Echo Statement

echo is used to output data to the screen. PHP echo statement can be used to print the string, multi-line strings, escaping characters, variable, array, etc. The echo statement can be used … Read more