Variable in PHP can be declared anywhere in the script. So the scope of the variable is defined by where it can be accessed in the script.In other words, it is the context where a variable is defined and accessed. PHP has three different kinds of scopes: Local Scope Global Scope Static Scope Local Scope […]
See MoreCategory: PHP
PHP Variable Types
PHP had different data types according to the values assigned to it. Like simple string, numeric types, arrays, and objects. PHP supports the following data types: Integer String Float Boolean Array Object NULL Resource Integers Integers are whole numbers without a decimal point. <?php $x = 200; // decimal number var_dump($x); echo "<br>"; $y = […]
See MorePHP Variables
Variables are names given to the location in memory, and these locations are used to store information. Creating PHP Variables The PHP variable always starts with a $ sign, followed by the variable name. Example:- <?php $name = "jack"; $age = 21; $height = 6.1; ?> After execution of this code, the variable $name holds […]
See MoreComments in PHP
PHP Comments are line embedded in the code, which is not executed by the server. Commenting on your code is a good habit if you are dealing with some big projects. Commenting helps others to understand your code easily, and it’s also helpful if you are checking your code after a long time. Think of […]
See MoreThe Basic PHP Syntax
PHP was created to work with the HTML code so that it can be easily embedded in the HTML pages. When you create a PHP file without adding any HTML tags, then it is called a pure PHP file. If you execute a PHP code on the server, then the plain HTML output is sent […]
See MoreServer and PHP Installation
PHP is a server-side scripting language used to create dynamic websites and applications. A web server is required to run the PHP code. So to learn PHP you have to daily work on running PHP code on the server. Working with an online server for daily learning is not a good option. For the learning […]
See MoreWhat is PHP?
PHP is actually a recursive acronym it stands for “PHP: Hypertext Preprocessor”. It is a server-side scripting language that is used for web development. PHP is a very powerful language and today millions of websites on the internet are using PHP. Almost all popular CMS like WordPress, Joomla, Drupal, etc are made in a PHP […]
See More