Arrays in PHP

Arrays in PHP Definition: Arrays in PHP are the special type of variable which can store similar type of data/ values inside a single variable. An array is one of the basic data structures. We can access each array variable using a key known as an index of the array. An array index can be … Read more

PHP Strings

PHP Strings Definition: PHP Strings are defined as the sequence of characters with a certain length. Example: “This is PHP Strings tutorial by codingkala.com”. Creating string variable: $str 1 = “This is strings in PHP tutorial”; $str2 = “123456”; //Numbers present inside double quotes will become strings of numbers. $str3 = ‘codingkala.com contains PHP and other programming … Read more

PHP Superglobal Variables

  PHP Superglobal Variables   In PHP web application all the data which includes HTTP request are automatically handled by certain variables. These are PHP Superglobal Variables. These variables collect the information automatically when any HTTP request occurs. The list of widely used PHP superglobal variables arrays are:   1. $_GET: $_GET collects all the … Read more

Scope of variables in PHP

Scope of variables in PHP is termed as the access level of a variable within the code. There are four types of scopes present in PHP for variables.   Local variable Global variable Static variable Function parameters Local Variables: Lets see local variable first in a function. function num1() { $num1 = 100; echo “Number -“.$num1; … Read more

PHP Functions

  What is a Function: PHP Functions are separate blocks of code which can be executed when gets called. A function can also accept optional parameters and after execution can return values to the caller. Let’s see PHP Functions in details. Syntax: <?php function showName($first_name, $last_name) { echo “This is full name – ” . $first_name … Read more

PHP Programming Loops

If you want to execute few lines of codes for a specific number of times repeatedly, then we will use PHP Programming Loops. We are having PHP Programming Loops types: while do…while for foreach There are two statements which are used in loops those are “continue” and “break“. 1. while loop: The first type in … Read more

PHP decision making statements

As the name suggests, PHP decision-making statements are used to make decisions in programming. We can also say when there is a situation where certain conditions occur in our program when a program has to take a decision to choose any specific option, then we use decision-making statements or “conditional logic“. We have three PHP … Read more

PHP Operators

This chapter is about the PHP Operators. What is Operator?: As its name suggests “operator” is a thing which can operate on different data. Or we can say that it is used to perform certain operations on data. PHP Operators are used in almost every operation you perform while programming.   To elaborate operator definition … Read more

Expressions in PHP

This chapter is about expressions in PHP. Anything which is having values we can call that as expressions in PHP. Examples: 12 2+2 $b $a = 10; [ad name=”Responsive Text”]   Any expression which is terminated by semicolon in PHP is called as ‘Statement’. In PHP programming, we use many statements to build complex and … Read more