Home  >  Article  >  Backend Development  >  How to learn php and what to learn

How to learn php and what to learn

PHP中文网
PHP中文网Original
2017-07-29 18:13:001909browse

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.

  1. Learning hello, world, everyone’s programming career seems to start with this sentence.

    How to learn php and what to learn

    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(&#39;MY_NAME&#39;,&#39;PHP中文网&#39;);

echo MY_NAME;
//下面是错误的调用方式
echo &#39;我的名字是MY_NAME&#39;;
//正确的调用方式该这么写
echo &#39;我的名字是&#39; . 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn