當前位置:學識都>好好學習>考研>

PHP數據運算類型都有哪些

學識都 人氣:2.97W

四種標量類型:

PHP數據運算類型都有哪些

boolean(布爾型) 理解爲真假型

integer(整型)

float(浮點型,也作“double”) 理解爲小數型

string(字符串)

兩種複合類型:

array(數組)

object(對象)

boolean(布爾型) 理解爲真假型

$bo=TRUE; $bo=FALSE;

integer(整型)

$bo=1; $bo=-12;

float(浮點型,也作“double”) 理解爲小數型

$bo=1.001; $bo=3.1415926;

string(字符串)

$bo=“這段字符串 or EN Word”;

array(數組)

$bo=array(1,2,3,4); $bo=array(“A”=>1 , “B”=>2);

TAGS:運算 PHP