The variable serves to store data while both types of strings, integers, or arrays. Variables in PHP is expressed with a $ sign at the beginning of variable names. The variable name can contain letters, numbers, and underscores. However, in the writing of variables must be prefixed with a letter or (_) underscore, followed by letters or numbers. Writing a character variable with the initial numbers are not justified. Examples of writing the correct variables are:
$ Var = “my variable”;
$ _var = “My variable”;
$ Var32 = “my variable”;
$ Var_var = “my variable”;
$ Var_var32 = “my variable”;
A variable is always followed by a variable value, the better the value of variables such as text / strings and numbers. If the variable does not yet have a value, then no need to be declared.Note that variables are case sensitive, meaning writing the variable name to distinguish the form of writing between lowercase and uppercase.
Giving value to a variable can also refer to other variables. The provision of reference values is expressed by giving the & in front of a variable as its value. Consider the following example:
<?
/ / Reference_variabel.php
$ First = “qualitypandits.com”;
$ & $ Second = first;
echo “<br> variable \ $ first = $ first”;
echo “<br> variable \ $ second = $ second”;
/ / If value $ first changed to be “programming sites”
echo “<br> variable \ $ first changed to be \” programming site \ “”;
$ First = “programming sites”
echo “<br> variable \ $ first = $ first”;
echo “<br> variable \ $ second = $ second”;
?>
make sure the results are as follows:

Variables in HTML form
From the HTML is part of a dynamic web page. With the form in a web page, visitors are expected to not only receive information, but can also interact by sending information to the web server. Part of this may contain HTML forms: text boxes, check boxes, radio buttons, drop down, test areas, and others.Data from this form is a variable that is sent to the server. The following are examples of variables that are sent from an HTML form:
<?
/ / forminput.php
if ($ submit) {
Echo “<br> Name: $ name”;
Echo “<br> Address: $ address”;
Echo “<br> Phone: $ phone”;
Echo “<br> Gender: $ genes”;
}
?>
<html>
<head>
<title> variables of the form </ title>
</ Head>
<body>
<form method=”POST” action=”forminput.php”>
<p> Name: <input type=”text” name=”name” size=”20″> </ p>
<p> Address: <input type=”text” name=”address” size=”30″> </ p>
<p> Phone: <input type=”text” name=”phone” size=”15″> </ p>
<p> Gender: <input type=”radio” value=”Male” checked name=”gen”> Male
<input type=”radio” value=”Female” name=”gen”> Female </ p>
<p> <input type=”submit” value=”Send” name=”submit”> </ p>
</ Form>
</ Body>
</ Html>
Run the above program on the browser and fill out the form completely as follows:

At the send button is pressed, the form will send the data carried by the variables to the destination file., File destination declared with action tags found on the form. Action tags is a parameter in a form that has a value name of the file where the data entered will be sent and processed form. The variables that carry the data is $ name, $ address and $ phone to the destination file, the file form.php. In a first step, the PHP program is in file form.php will examine whether the variable $ submit submitted.Furthermore, if the variable $ submit submitted, then the overall value of the variable will be printed using the echo function in a PHP program.
Constants
Constant is a variable that has a fixed value and need not be declared with a $ sign. Constants are declared using the function define ().
Incoming search terms:
- PHP Variables from HTML forms
- &$ php variables
- allintext:php variables and you may use these html tags and attributes: <a href= title=>
- php constant vs variable performance
- php programming software names
- submit and send button
- types of variables in php programming