Author: rushi instarr

Operators

PHP Operators PHP Operator is a symbol i.e used to perform operations on operands. In simple words, operators are used to perform operations on variables or values. For example: $num=10+20;//+ is the operator and 10,20 are operands In the above example, + is the binary + operator, 10 and 20 are operands and $num is variable. PHP Operators can be categorized in following forms: Arithmetic Operators Assignment Operators Bitwise Operators Comparison Operators Incrementing/Decrementing Operators Logical Operators String Operators Array Operators Type Operators […]

Oops

  PHP What is OOP? OOP stands for Object-Oriented Programming. Procedural programming is about writing procedures or functions that perform operations on the data, while object-oriented programming is about creating objects that contain both data and functions. Object-oriented programming has several advantages over procedural programming: OOP is faster and easier to execute OOP provides a clear structure for the programs OOP helps to keep the PHP code DRY “Don’t Repeat Yourself”, and makes the code […]

Functions

  PHP Functions PHP function is a piece of code that can be reused many times. It can take input as argument list and return value. There are thousands of built-in functions in PHP. Advantage of PHP Functions Code Reusability: PHP functions are defined only once and can be invoked many times, like in other programming languages. Less Code: It saves a lot of code because you don’t need to write the logic many times. […]

Features

  Features of PHP The main features of php is; it is open source scripting language so you can free download this and use. PHP is a server site scripting language. It is open source scripting language. It is widely used all over the world. It is faster than other scripting language. Some important features of php are given below; Features of php It is most popular and frequently used world wide scripting language, the […]

Loops

PHP Loops Often when you write code, you want the same block of code to run over and over again a certain number of times. So, instead of adding several almost equal code-lines in a script, we can use loops. Loops are used to execute the same block of code again and again, as long as a certain condition is true. In PHP, we have the following loop types: while – loops through a block […]

Loops

  PHP Loops Often when you write code, you want the same block of code to run over and over again a certain number of times. So, instead of adding several almost equal code-lines in a script, we can use loops. Loops are used to execute the same block of code again and again, as long as a certain condition is true. In PHP, we have the following loop types: while – loops through a […]

Data Types and Constants

PHP Data Types PHP data types are used to hold different types of data or values. PHP supports 8 primitive data types that can be categorized further in 3 types: Scalar Types (predefined) Compound Types (user-defined) Special Types   PHP Data Types: Scalar Types It holds only single value. There are 4 scalar data types in PHP. boolean integer float string   PHP Data Types: Compound Types It can hold multiple values. There are 2 […]

loops

PHP Loops Often when you write code, you want the same block of code to run over and over again a certain number of times. So, instead of adding several almost equal code-lines in a script, we can use loops. Loops are used to execute the same block of code again and again, as long as a certain condition is true. In PHP, we have the following loop types: while – loops through a block […]

data types and constants

PHP Data Types PHP data types are used to hold different types of data or values. PHP supports 8 primitive data types that can be categorized further in 3 types: Scalar Types (predefined) Compound Types (user-defined) Special Types PHP Data Types: Scalar Types It holds only single value. There are 4 scalar data types in PHP. boolean integer float string PHP Data Types: Compound Types It can hold multiple values. There are 2 compound data […]

Syntax and variables

Basic PHP Syntax. A PHP script can be placed anywhere in the document. A PHP script starts with <?php and ends with ?>: <?php // PHP code goes here ?> The default file extension for PHP files is “.php“. A PHP file normally contains HTML tags, and some PHP scripting code. Below, we have an example of a simple PHP file, with a PHP script that uses a built-in PHP function “echo“ to output the […]

Next Page »