PHP Switch statement

The switch statement is similar to if..else statement only. In many situation, you may need to check / compare different values with the same variable. In that situation switch statement really helps. Switch case is bit faster compare with series of if statement. <?php $x = “announcement”; switch ($x) { case “login”: echo “You are … Read more

PHP if…else Statements

PHP having different types of conditional statements like C and C ++. Below we listed the conditional statements presents in PHP.. if statement if … else statement if … elseif ….. else statement Nested if  statement switch statement For more information please Click Here.

PHP Constants

A constant is a name/identifier for a simple value. The constant value can not able to change during the time of script execution. The constants are defined using define() function. It will return either constant value of NULL. Two types of constants are there. They are, Case-sensitive constants Case-insensitive constants Case-sensitive <?php define(“MAX_SIZE”,”100″); echo MAX_SIZE; … Read more

PHP String functions

PHP strings are sequences of characters, like ” Hello World “. In this chapter we will see the commonly used string functions. str_len() Function This function is used get the total number of characters in string . <?php echo str_len(“Test String”); ?> Output: 11 addslashes() Function This function will return the string with backslashes in-front of … Read more

PHP Data Types

A data type refers to, the type of data/details a variable can store. PHP has totally eight data types. They are separated  as three major types. They are Scalar , Compound and special types. Below we listed out all the data types. Scalar Types: Boolean Integer String Float Compound Types: Object Array Special Types: NULL Resources … Read more

PHP Variables

A variable is just a storage element. Variables in PHP are represented by a dollar sign ( $ ) by the name of the variable. The variable name is case-sensitive. The variable name should be start with letters ( a-zA-Z ) or underscore ( _ ) and it should not start with numeric /number Below … Read more

PHP Echo / Print

In PHP there is 2 ways to print output: echo print echo is bit faster compare with print. echo can output one or more strings print can only output one string, and it returns value as 1. Echo echo is a language construct, and can be used with or without parentheses: echo or echo(). <?php … Read more

PHP Syntax

Any where we can use PHP script inside of the document. The PHP script start  with <?php and ends with ?> <?php // PHP code goes here ?> The default file extension is .php  ( Eg. test.php ) Example : To get a fell of PHP code, first we will start  with simple PHP script. Since … Read more

PHP Introduction

Basic Knowledge Before you are going to start PHP you should have a basic knowledge of the following : HTML CSS Javascript What is PHP ? PHP :: Hypertext Preprocessor PHP is server side scripting language PHP is open source scripting language PHP is free of cost and its free to download and use. Why … Read more

PHP Home

PHP –> Hypertext Preprocessor PHP is a Server side scripting language PHP is widely used and free of cost. Before proceeding with this tutorial you should have the basic knowledge of computer programming , internet , Database and Mysql. For testing you can use online editor compileonline.com