1. Download an integrated environment software, that is, others put all the messes in one piece and make it into software. This is SG-style. I think it is better for beginners to use this;
2. Download and install them separately.; This method is the most messy and has not yet been clarified.
Because I have iis installed on the machine, I just installed php and zend. Now I can run php and asp on the server at the same time.
PHP is embedded in html. As follows:
<?php
$a="Hello";
$b=" php";
echo $a.$b;
?>
illustrate:
Define a variable with the $ variable name, such as $a$b above. When referring to this variable, you should also use the $ variable name to reference;
After each statement is finished, a ';' number should be added to indicate the end;
When outputting, use echo to output content;
$a.$b;The '.' number in this is used to concatenate two strings.
The running result of the above program is:
Hello, PHP!
Output php information:
<?php
phpinfo();
?>
If statement in php:
<?php
$a=10;
$b=1;
if($a==$b){
echo "a=b";
}
?>
The output result is:
a=b
MD5 password function, anyone who has done the web knows md5, this is just a function in PHP, and it will be OK if you call it:
<?php
$a="php";
$b=md5($a);
echo $b;
?>
The output result is:
e1bfd762321e409cee4ac0b6e841963c
2. Download and install them separately.; This method is the most messy and has not yet been clarified.
Because I have iis installed on the machine, I just installed php and zend. Now I can run php and asp on the server at the same time.
PHP is embedded in html. As follows:
<?php
$a="Hello";
$b=" php";
echo $a.$b;
?>
illustrate:
Define a variable with the $ variable name, such as $a$b above. When referring to this variable, you should also use the $ variable name to reference;
After each statement is finished, a ';' number should be added to indicate the end;
When outputting, use echo to output content;
$a.$b;The '.' number in this is used to concatenate two strings.
The running result of the above program is:
Hello, PHP!
Output php information:
<?php
phpinfo();
?>
If statement in php:
<?php
$a=10;
$b=1;
if($a==$b){
echo "a=b";
}
?>
The output result is:
a=b
MD5 password function, anyone who has done the web knows md5, this is just a function in PHP, and it will be OK if you call it:
<?php
$a="php";
$b=md5($a);
echo $b;
?>
The output result is:
e1bfd762321e409cee4ac0b6e841963c