当前位置:网站首页>PHP basic syntax
PHP basic syntax
2022-07-05 13:43:00 【Sex sex ~ ~】
One 、 initial PHP Script program
1.PHP Language marks
1)PHP Start marker :<?php
2)PHP End mark :?>
3) Our page is finally through html,css,js To show a gorgeous interface
4)PHP Code can be embedded in html Anywhere in the code , And can embed any number of
5) The end of the file "?>" The end flag can be omitted
2 . Instruction separator ";"
1) In some PHP Add... At the end of the statement ";" It means the end of a sentence , Of course, you don't need to miss the semicolon , The program can't be executed at all , Will report a mistake .
2) End mark "?>" It implies a “;” So in "?>" Previous PHP Statements can be omitted ";"
3. notes
1) Multiline comment
/* Things that need annotation */
2) Single-line comments
// Things that need annotation
Two 、 Variable ( A container for temporarily storing data )
1、 Declaration of variables
C Language must define variables at the beginning of the code , Is a declaration , And in the PHP In the program , Variables do not need to be declared before they are used .(“=” stay php It also means assignment )
2. Destruction of variables
unset ($ Variable name )
3. Naming rules for variables
1) Variable names are strictly capitalized
$name, $NANE, $Name It's all different variables
2) Only start with letters or underscores
* Variable names can only contain Letter Numbers Underline And must start with a letter or underscore
4. Volatile variables
5. Reference assignment of variable
边栏推荐
- Simple PHP paging implementation
- Kotlin协程利用CoroutineContext实现网络请求失败后重试逻辑
- jenkins安装
- Solve the problem of "unable to open source file" xx.h "in the custom header file on vs from the source
- ETCD数据库源码分析——rawnode简单封装
- NFT value and white paper acquisition
- redis6数据类型及操作总结
- When using Tencent cloud for the first time, you can only use webshell connection instead of SSH connection.
- The development of speech recognition app with uni app is simple and fast.
- 【Hot100】33. Search rotation sort array
猜你喜欢
华为推送服务内容,阅读笔记
The development of speech recognition app with uni app is simple and fast.
Nantong online communication group
[notes of in-depth study paper]transbtsv2: wider instead of deep transformer for medical image segmentation
"Baidu Cup" CTF competition in September, web:sql
redis6事务和锁机制
Operational research 68 | the latest impact factors in 2022 were officially released. Changes in journals in the field of rapid care
These 18 websites can make your page background cool
Backup and restore of Android local SQLite database
Huawei push service content, read notes
随机推荐
leetcode 10. Regular expression matching regular expression matching (difficult)
Usage, installation and use of TortoiseSVN
53. 最大子数组和:给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。
redis6数据类型及操作总结
[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging
NFT value and white paper acquisition
Datapipeline was selected into the 2022 digital intelligence atlas and database development report of China Academy of communications and communications
Zhubo Huangyu: these spot gold investment skills are not really bad
【Hot100】33. Search rotation sort array
Prefix, infix, suffix expression "recommended collection"
ELK 企业级日志分析系统
Huawei push service content, read notes
Internal JSON-RPC error. {"code":-32000, "message": "execution reverted"} solve the error
Backup and restore of Android local SQLite database
Aspx simple user login
These 18 websites can make your page background cool
Resttemplate details
[MySQL usage Script] catch all MySQL time and date types and related operation functions (3)
法国学者:最优传输理论下对抗攻击可解释性探讨
What are the private addresses