Home > Article > Backend Development > How to learn php and what to learn
In 2017, I went to Beijing for a university internship. I went to Beijing to learn PHP and worked for a while. Although I am not engaged in professional PHP work now, I still remember that learning experience. At that time, I was studying in a full diary. From morning to night, I kept practicing and took notes in four notebooks. Now I will share my learning experience with you. After all, mastering a technology is still very important in this society.
Learn the basic syntax of PHP.
Learning hello, world, everyone’s programming career seems to start with this sentence.
Recommended learningLearn php in one weekTutorial
2. Embedding method, learning of program comments
<?php //声明一部iphone6手机的价格变量 $iphone6_price = 6088; //显示输出手机价格 echo $iphone6_price; ?>
Course link: http://www.php.cn/code/976.html
3 Learning of constants and variables
<?php define('MY_NAME','PHP中文网'); echo MY_NAME; //下面是错误的调用方式 echo '我的名字是MY_NAME'; //正确的调用方式该这么写 echo '我的名字是' . MY_NAME; ?>
Course link: http://www .php.cn/code/995.html
4. Basic operation symbols such as: arithmetic operations, string operations, assignment operations, logical operations, etc.
<?php $x = 20; $y = 15; //20 -15 为5 echo $x - $y; ?>
Course link: http://www.php.cn/code/1047.html
5 PHP process control, if..else loop; do..while; for loop Wait
<?php $week=date("4"); //判断星期小于6,则输出:还没到周末,继续上班..... if ($week<"6") { echo "还没到周末,继续上班....."; } ?>
Course link: http://www.php.cn/code/1071.html
6 Learning of functions and classes.
<?php //定义一条函数狗 function php_cn(){ $foo = 5; $bar = 6; $result = $foo + $bar; //将$result的结果进行返回 return $result; } //调用php_cn()这个函数,$foo和$bar相加的$result就会返回回来给到变量$piao $piao = php_cn(); //输出$piao的结果,果真为11 echo $piao; ?>
Course link address: http://www.php.cn/code/1084.html
7. Learn to read PHP Function Manual.
Learn various program examples of PHP, such as calculators, chat rooms, message boards, etc. The editor has practiced these.
Learn basic HTML code. Learn basic HTML CSS code, because the establishment of a website includes front-end and back-end programs. Although those working on the back-end do not need to be completely proficient in the front-end, basic tags can be used when writing programs.
Mysql database learning. The database that works with PHP is Mysql, SQL statements, etc.
The above is the detailed content of How to learn php and what to learn. For more information, please follow other related articles on the PHP Chinese website!