Sunday, May 26, 2019

PHP Variables!!

PHP Variables!!



In this article we will discuss about PHP variables.

How To Declare a Variable 


In PHP variable is declared with $ sign.

Value can be stored in variable is string, integer, float, Boolean, null etc..

Program :


Output :

Hello khush
5

As we can see in above program we store string in variable x, integer in y and float in z.

After that we simply print it as $x. in PHP when we print variable we must have to use $ with variable.

echo / print


In PHP we can print message with help of  print or echo.

The output remain same of both keyword.

Program :


Output :

How are you? // using print
How are you?  // using echo

As we can see we use print and echo and output is same

Different Method Of Print Variables.


We can print variable as simple by it's name with $ sign.

We can print with any string, just we have to write variable name where we have to use.

We can implement HTML property in message with variable in a single line.

If we want to give separate property then we can concat with " . '.

Program :


Output :

How are you?
Hello !! How are you?
How are you?
How are you?

As we can see in above program we print variable in different ways.

Also we can print variable with quotation or without quotation.

Let's see an example,

Program :


Output :

Hello!!How are you? 
Hello!!How are you? 

Operator ' + ' In PHP


In other languages ' + ' is used for concatenation but in PHP for concatenation ' . ' is used.

' + ' operator in PHP is used for operation of only numeric value.

It works as a addition of two numbers.

If we store string instead of number then it generates error "non-numeric value is encountered"

Program :

Output :
7

As we can see here we take two integer values and when we use ' + ' operator, it returns 5 + 2 = 7 in output.

In this article we discuss about different methods for use of variables in brief.
Mesothelioma Survival Rates , Mesothelioma Attorneys California , Seattle Mesothelioma Lawyer , Mesothelioma Suit , Mesothelioma Claim , Wisconsin Mesothelioma Attorney , Mesothelioma Attorney illinois , Mesothelioma Trial Attorney ,Houston Mesothelioma Attorney , Mesothelioma Lawyer Dallas , New York Mesothelioma Law Firm,Mesothelioma Lawyer Asbestos Cancer Lawsuit , Mesothelioma Lawyers San Diego,Mesothelioma Litigation , Mesothelioma Attorney Assistance , Mesothelioma Lawyer Asbestos Cancer Lawsuit , Mesothelioma Lawyer Chicago , New York Mesothelioma Law Firm , 


Houston Mesothelioma Attorney , Mesothelioma Lawyer Dallas , Mesothelioma Care , Mesothelioma Trial Attorney , Mesothelioma Lawyer Texas , Lawsuit Mesothelioma  , Truck Accident Attorney Los Angeles ,Asbestos Exposure Lawyers  , Mesothelioma Cases  , Emergency Response Plan ppt , Mesothelioma Lawyers San Diego  , Asbestos Mesothelioma Lawsuit  , Tennessee Mesothelioma Lawyer , Meso Lawyer  , Mesothelioma Settlements Amounts  , Mesothelioma Law Firms , New Mexico Mesothelioma Lawyer , Accident Attorneys Orange County , Mesothelioma Lawsuit ,Personal Injury Accident Lawyer  , Purchase Structured Settlements  , Firm Law Mesothelioma , Car Accident Lawyers Los Angeles , Mesothelioma Attorneys , Structured Settlement Company  , Auto Accident Lawyer San Francisco  , Mesotheolima  , Los Angeles Motorcycle Accident Lawyer


Mesothelioma , Mesothelioma Lawyer Virginia , Seattle Mesothelioma Lawyer , Mesothelioma Attorney illinois , Mesothelioma Drug , Mesothelioma Attorney DirectoryMesothelioma Settlements , Mesothelioma Help  , Mesothelioma ct , Mesothelioma Attorney Florida , Washington Mesothelioma Attorney , Best Mesothelioma Lawyers , Diagnosed With Mesothelioma , Mesothelioma Settlement Amounts , Mesothelioma Personal Injury Lawyers , Mesothelioma Compensation , Attorney Lawyer Mesothelioma  ,Colorado Mesothelioma Lawyers,Mesothelioma Lawsuits , Mesothelioma Claims , Average Mesothelioma Settlement , Average Mesothelioma Settlement , Mesothelioma Law Suit , Alabama Mesothelioma Lawyer , alabama Mesothelioma Lawyer , utah mesothelioma lawyer , Dallas Mesothelioma Lawyer , Mesothelioma Attorney California , Mesothelioma Lawyer California ,Mesothelioma Survival Rates ,

Mesothelioma Attorneys California, Wisconsin Mesothelioma Attorney Mesotheliama , Mesothelioma Lawyer Virginia , Seattle Mesothelioma Lawyer , Mesothelioma Attorney illinois, Mesothelioma Trial Attorney Injury Lawyer Houston tx , Baltimore Mesothelioma Attorneys , Mesothelioma Care ,Mesothelioma Trial Attorney ,Mesothelioma Lawyer Texas , Mesothelioma Lawyer Dallas , Mesothelioma Care , Mesothelioma Trial Attorney , Mesothelioma Lawyer Texas , California Mesothelioma Attorney Philadelphia Mesothelioma Lawyer , Illinois Mesothelioma Lawyer , Mesothelioma Attorney , Mesothelioma Claims , Average Mesothelioma Settlement 
Integrated ehr , Mesothelioma Law Sui , Mesothelioma Lawyer California,Mesothelioma Attorney California ,Mesothelioma Law Suits ,Dallas Mesothelioma Attorneys ,Mesothelioma Drug ,Mesothelioma Attorney Directory