PHP variables are not type , which is completely different from C language, C language inside we define a variable must be added variable type, such as int a=10; Char b[10]={0}; in PHP we define a variable like this
$length = 100;
To see its characteristics, it is to define a variable with a "dollar sign at the beginning plus variable name" .
There are some advantages and disadvantages of variable types and languages that do not have variable types.
C language is a variable type, because C language born earlier, that time memory is more tense, wasting memory is lethal ah, so memory area is divided into triangular area, square area, circular area, if the triangle must be placed in the Triangle area inside, other areas are not put in, The rest is the same. The advantages are obvious, make full use of memory, save resources, the shortcomings are obviously not flexible, the memory management of this technology content is higher than the work of programmers to complete, the programmer requirements are relatively high.
PHP is not a variable type, because with the progress of science and technology, memory space is relatively less tense, in order to write programs more efficiently, in order to liberate productivity, PHP was designed to be no variable type. The area of memory is divided into large jars, whether you are a triangle or a circle or a square, which you can put in. The advantages are obvious, very flexible, the programmer does not need to focus on memory management, the shortcomings are not yet known, it may be more waste of memory.
Points to note:
Variables in 1.PHP are case-sensitive.
2. This is a mistake I often make when defining a variable with a dollar sign and forgetting to write a dollar sign when referencing a variable.
<?php
$books = ' Chinese ';
Echo Books;
OUTPUT Books
?>
<?php
$books = ' Chinese ';
Echo $books;
OUTPUT Chinese
?>
The definition of variables in PHP learning note-php