1. Download an integrated environment software, that is, others put all the mess together and make it into software. This is SG style, and I think it is suitable for beginners. This is a good point;
2. Download and install .php.zend.apache separately; This method is the most confusing and I haven’t figured it out yet.
I installed php because IIS is installed on the machine. Just like zend. Now you can run php and asp at the same time on the server.
php is embedded and run in html. As follows:
<?php $a="你好"; $b=" php"; echo $a.$b; ?>
Instructions:
Define a variable with $ Variable name, as shown above $a $b, when referencing this variable, also use $ variable name to quote;
After each statement is completed, add a ';' sign to indicate the end;
Use echo to output the content Come;
$a.$b;The '.' sign in this is used to connect 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 encryption function, do Everyone who has been through the web knows md5. This is just a function in php. Just call it:
<?php $a="php"; $b=md5($a); echo $b; ?>
The output result is:
e1bfd762321e409cee4ac0b6e841963c
The above is the detailed content of 4 tips for getting started with PHP. For more information, please follow other related articles on the PHP Chinese website!