当前位置:网站首页>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 referenceSeveral partitions of memory:
Stack area, code segment, data segment, heap area.
边栏推荐
猜你喜欢
随机推荐
宝塔搭建企业招聘网站源码实测
腾讯电竞的蓝翔梦
技术干货|如何将 Pulsar 数据快速且无缝接入 Apache Doris
Is OnePlus Ace worth buying?Use strength to interpret the power of performance
什么是鉴权?一篇文章带你了解postman的多种方式
【Azure 事件中心】使用Azure AD认证方式创建Event Hub Consume Client + 自定义Event Position
mysql之的执行计划
基于PHP7.2+MySQL5.7的回收租凭系统
新“妖股”13个交易日暴涨320倍,市值3100亿美元超阿里
一文带你弄懂 CDN 技术的原理
Dataworks中PyOdps里面pandas.read_sql()支持Odps吗?
【JS】利用JS给删除按钮添加提示框
ASA归因:如何评估关键词的投放价值
如何成为优秀的产品运营?
分享 14 个你必须知道的 JS 函数
云GPU如何安装和启动VNC远程桌面服务?
@resource和@autowired的区别
BigInteger :new BigInteger(tokenJson.getBytes()).toString(16)什么意思
flink-sql 客户端,咋回事 我show tables 报错
MVCC多版本并发控制的理解









