php基础学习之变量的使用,学习php的朋友可以参考下。
代码如下:
//引用
$one="test";
two=&$one;//相当于传地址,两个变量指向一个地址
//动态变量
$one="######";
$two="one";
$three="two";
echo $three."
";//输出"two"
echo $$three."
";//输出"one"
echo $$$three."
";//输出"######"
//php中有8个类型
//4种标量: int integer
// bool boolean
// float,double,real
// string
//2种复合类型: array
// object
//2种特殊类型: 资源类型 resource
// 空类型 null
//整数的声明
$int=10; //十进制声明
$int=045;//八进制声明
$int=0xff;//十六进制声明
$float=3.14E+5;//科学计数法
$float=3.14E-5;
//一下都是false的情况
$bool=false;
$bool=0;
$bool=0.000;
$bool=null;
$bool="";
$bool=" ";
$bool="0";
$bool=array();
//字符串的声明
//1.单引号和双引号都可以声明字符串
//2.声明的字符串没有长度限制
//3.在双引号的字符串中,既可以直接解析变量,又可以直接使用转义字符(可以转义单引号本身,也可以转义转义字符"\")
//4.在单引号的字符串中,不可以直接解析变量,也不可以使用转义字符
//5.在双引号中不能再使用双引号,在单引号中不能再使用单引号
//6.最好使用单引号,
$str='aaaaa';
$str="aaaa";
//定界符声明字符串,大量字符串
//test是自定义的一个字符串,后面不能有任何字符,空格也不可以
//也要以test这个自定义的字符串结束,结束前不能有任何字符
$str=this write content......
test;
>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
