PHP Switch statement

In this lesson, you will learn how to use the PHP switch statement which lets you an easy alternative of writing multiple if-else statements. PHP switch Statement PHP switch statement compares a variable or an expression against many different values and executes an associated code block if the comparison results as Boolean value true. Example... » read more

PHP if-else

In this lesson, you will learn how to use conditional statements in PHP. Conditional statements can change the flow of the program depending on the conditions being met. PHP if statement The ‘if statement’ is a conditional statement in PHP which evaluates an expression between parenthesis. If this expression is evaluated as true, the block... » read more

PHP Operators

In this lesson, you will learn how to use PHP operators to perform arithmetic and logic operations on the data. An operator takes one or more variable known as operands, to manipulate data items. PHP has followed the syntax of C and Perl for its operators. PHP Operators Below are the most utilized operators in... » read more

PHP Strings

In this lesson, you will learn how to create, store or manipulate strings in PHP. A string is a type that contains letters, numbers, and symbols or a combination of these. How to create a string in PHP The simplest way to create a string in PHP is to enclose the string literal in single... » read more

PHP Echo and Print

In this lesson, you will learn about echo and print statements. We have already seen hello.php example in Lesson 1 when the echo statement is used to display a text string. PHP’s primary function is to output HTML. Almost every action PHP performs ends up with outputting HTML onto a webpage. PHP Echo Statement In... » read more

PHP Variables

In this lesson, you will learn about variables in PHP. A variable is a special container that you can define to hold data or value. PHP is a loosely typed programming language, but there are a few rules about declaring and storing variables. Introduction to PHP Variables Below are the rules when it comes to... » read more

PHP Syntax

In this lesson, we will teach you the basic syntax of PHP language. PHP files are saved with .php extension. Inside a PHP file, you can write HTML code just like you do in regular HTML pages as well as embedded PHP code blocks to execute on the server-side. PHP is a quite simple language... » read more

Introduction to PHP

What is PHP? PHP code can be embedded into the HTML page, and after the execution, it will generate HTML which is sent to the client. The client will only be able to see the HTML and would not know the PHP code behind the HTML. The best thing about PHP is it is not... » read more