if in php

if statement You can use an if statement to make a decision. You should give the if statement a condition to use. If the condition is true, the following block of code will be executed. Conditions in if statements must be surrounded by parentheses () Example

Variable scope in php

The term scope refers to the places within a script where a particular variable is visible. The six basic scope rules in PHP are as follows: Built-in superglobal variables are visible everywhere within a script Constants, once declared, are always visible globally; that is, they can be used inside and outside functions Global variables declared … Read more

Type Casting in php

Type Casting in php through that we can pretend that a variable or value is of a different type by using a type cast. This feature works identically to the way it works in C. You simply put the temporary type in parentheses in front of the variable you want to cast. For example, you … Read more

Type strength in php

PHP is called a weakly typed or dynamically typed language. In most programming languages, variables can hold only one type of data, and that type must be declared before the variable can be used, as in C. In PHP, the type of a variable is determined by the value assigned to it. For example, when … Read more

php Data Types

PHP supports the following basic data types Integer—Used for whole numbers Float (also called double)—Used for real numbers String—Used for strings of characters Boolean—Used for true or false values Array—Used to store multiple data items Object—Used for storing instances of classes Three special types are also available: NULL, resource, and callable. Variables that have not … Read more

PHP Tags

The PHP code in the preceding example began with . This is similar to all HTML tags because they all begin with a less than () symbol. These symbols () are called PHP tags. They tell the web server where the PHP code starts and finishes. Any text between the tags is interpreted as PHP. … Read more

What Is PHP ?

PHP is a server-side scripting language designed specifically for the web. Within an HTML page, you can embed PHP code that will be executed each time the page is visited. Your PHP code is interpreted at the web server and generates HTML or other output that the visitor will see. PHP was conceived in 1994 … Read more