当前位置:网站首页>PHP base notes - NO. 1
PHP base notes - NO. 1
2022-08-03 18:09:00 【WDm-xmax】
Original ID: GUIDM
I was so busy in July that I didn't have time to update, and I didn't read all the private messages sent by everyone on CSDN, so I'm very sorry everyone.
Recently learning PHP, JavaScript advanced version is temporarily suspended.After learning PHP to update the front-end content.
The PHP column is purely a study note recorder.thanks for your support.
Table of Contents
1. Basic introduction
- PHP: (Hypertext Preprocessor), a widely used open source general server scripting language, suitable for web development and embedded in HTML.
- A programming language that does not require compilation and is directly executed by an interpreter/virtual machine
- PHP program execution flow:
2. PHP program
- Default extension: .php
- The php file can contain: html, css, JavaScript code.
Several tags:
1. ASP tags:
<% PHP code %>
2. Short tag:
3. Script tags:
4. Standard markup:
- Common tags are: standard tags.
- ASP and short tags are basically deprecated, if you want to use them, you need to open them in the configuration file
PHP syntax:
- ";" indicates the end of the statement.
- {} indicates the end of a statement.
- The closing tag of a PHP block also automatically indicates a semicolon (so there is no need to use a semicolon on the last line of a PHP block)
Notes
- (#)//Single line comment
- /* */Multi-line comment
/**@author:*@Function:*/
Habit: All code must be commented while writing.
The firstAn output function
- The
- echo() function outputs one or more strings.
3. PHP variables
Variable definition: Add the corresponding variable name (memory) in the system.
- Variable declaration: $variable name.
Assignment: You can assign data to a variable (this can be done at the same time as the definition).
Variable Naming Rules
Numbers cannot be used at the beginning of
- .
- There must be no spaces in between.
- Three nomenclatures:
Underline nomenclature: Link 2 English words with underscores.Such as: one_two Small camel case: capitalize the first letter of the second word such as: newFile CamelCase: Capitalize the first letter of all words eg: NewFile
The mixing of html and PHP needs to be under the PHP file.
With the same variable name together, the next sentence will cover the above sentence.
Variables
If the value stored by a variable happens to be the name of another variable, then you can get the value of another variable directly by accessing a variable: add an extra $ sign before the variable.
Process:
- Find $a, interpret the result as "b";
- Bind the preceding $ sign to the result b;
- The result of the analysis is bb;
value by variable
Assign one variable to another.
- Value transfer: copy the value saved by the variable, and save the new value to another variable (the two variables are not related).$a=$b
- Pass by reference: Pass the memory address where the value stored by the variable is located to another variable.Two variables point to the same memory space (two variables are the same value.) $new variable=&$old variable
//Value transfer:// pass by reference
Several partitions of memory:
Stack area, code segment, data segment, heap area.
边栏推荐
- Web3 security risks daunting?How should we respond?
- es6新增-Promise详解(异步编程的解决方案1)
- 常见亲脂性细胞膜染料DiO, Dil, DiR, Did光谱图和实验操作流程
- PHP基础笔记-NO.1
- Mock模拟数据,并发起get,post请求(保姆级教程,一定能成功)
- 借助kubekey极速安装Kubernetes
- 揭秘deepin 23,从这里开始!
- AI智能剪辑,仅需2秒一键提取精彩片段
- How to install and start VNC remote desktop service on cloud GPU?
- 【美丽天天秒】链动2+1模式开发
猜你喜欢
随机推荐
Postgresql 备份大小情况!
Cyanine5.5 alkyne|Cy5.5 alkyne|1628790-37-3|Cy5.5-ALK
mysql之数据库账户管理与优化
【Azure 事件中心】使用Azure AD认证方式创建Event Hub Consume Client + 自定义Event Position
JVM参数设置
计网知识点
Blender script 删除所有幽灵对象
PHP基础笔记-NO.2
什么是鉴权?一篇文章带你了解postman的多种方式
15、学习MySQL NULL 值处理
PHP基础笔记-NO.1
高等数学---第十章无穷级数---常数项级数
关于vscode安装包下载太慢解决方法
yaml数据格式
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(十一)
揭秘deepin 23,从这里开始!
中国算力大会昇腾鲲鹏生态论坛举办;快手成立独立to B业务部门…
Trie思想及模板
云图说丨初识华为云微服务引擎CSE
STM32——LCD—FSMC原理简介