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

Basic Syntax in php

PHP is quite a simple language with roots in C and Perl, yet it looks more like Java. It is also very flexible, but there are a few rules that you need to learn about its syntax and structure Semicolons $x += 10; The $ symbol Variables String variables $username = “Fred Smith”; first PHP … Read more

Comments in php

There are two ways in which you can add comments to your PHP code. The first turns a single line into a comment by preceding it with a pair of forward slashes // This is a comment A multiline comment

What Is a WAMP, MAMP, or LAMP ?

WAMP, MAMP, and LAMP are abbreviations for “Windows, Apache, MySQL, and PHP,” “Mac, Apache, MySQL, and PHP,” and “Linux, Apache, MySQL, and PHP.” These abbreviations describe a fully functioning setup used for developing dynamic Internet web pages WAMPs, MAMPs, and LAMPs come in the form of a package that binds the bundled programs together so … Read more