当前位置:网站首页>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.
边栏推荐
猜你喜欢
MySQL database account management and optimization
H.265网页播放器EasyPlayer获取视频流正常,但是播放出现黑屏是什么原因?
Weekly recommended short video: In order to fill the gap of learning resources, the author specially wrote a book?
Jenkins CI平台(二)
图像传感第一章学习心得
技术干货|如何将 Pulsar 数据快速且无缝接入 Apache Doris
gcc的学习及 版本太低如何在conda环境下重新进行安装
CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes), problem: (D) Magical Array
并查集模板及思想
一文带你弄懂 CDN 技术的原理
随机推荐
Share 14 JS functions you must know
Execution plan of mysql
一加Ace值得买吗?用实力诠释性能的强大
BigInteger :new BigInteger(tokenJson.getBytes()).toString(16)什么意思
es6新增-Generator(异步编程的解决方案2)
链表中倒数第k个结点
WebGL管网展示(及TubeGeometry优化)
宝塔搭建企业招聘网站源码实测
异常与智能指针
Crack: WebKitX ActiveX and WebKitX VHX
技术干货|如何将 Pulsar 数据快速且无缝接入 Apache Doris
EasyNTS上云网关断电重启后设备离线是什么原因?
003_Kubernetes核心技术
AI智能剪辑,仅需2秒一键提取精彩片段
mysql之的执行计划
JS string to GBK encoding ultra-reduced implementation
我们为何看好投资 DAO?
flink-sql 客户端 可以设置并行度 吗?断开算子链
CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-E
【用户运营】用这4个最佳客户服务策略,减少客户流失率