Home  >  Article  >  php教程  >  php数据类型01

php数据类型01

WBOY
WBOYOriginal
2016-06-06 19:57:571500browse

1.数据类型: 标量类型:整型(int),浮点型(float),字符串型(string),布尔型(boolean) 符合类型:数组(array),对象(object) 其他类型:资源(resource),NULL 2.$a = 123; echo 11$a; //$a能打出来 echo 11$a11; //$a打不出,php默认$a11是一

1.数据类型:

        标量类型:整型(int),浮点型(float),字符串型(string),布尔型(boolean)

        符合类型:数组(array),对象(object)

        其他类型:资源(resource),NULL

 

2.$a = "123";

       echo "11$a";           //$a能打出来

       echo "11$a11" ;      //$a打不出,php默认$a11是一个变量,解决方法如下:

       echo "11{$a}11";      //php只解析大括号里的变量

3.结尾定界符前不能有任何东西,要顶行写

             $a =

           
                  
                
                           

123

               
           
xxx;                   //要顶行写
echo $a;

4.为false的布尔类型:

    FALSE , 0 , 0.0 ,  空字符串 ,字符串为0 ,NULL ,空数组

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn