Blogger Information
Blog 2
fans 0
comment 0
visits 507
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
8.3日作业
手机用户1627113079
Original
254 people have browsed it
1.php变量的8种数据类型?

包括4种标量类型:布尔型,整形,浮点型和字符串类型;两种复合类型:数组和对象;两种特殊类型:resource通和null

2.php变量类型的转换?

临时转换、强制转换、系统自动转换

3. 如何定义php常量, 实例演绎php变量与常量的区别?

常量定义有两种方式:define(),const
常量是全局变量,不受作用域限制,变量不是全部变量,受作用域限制;常量变量可用类型不同;常量一旦定义,不可更改、变量可进行更改

  1. //定义变量并输出
  2. $a=50;
  3. echo $a;
  4. echo('<br>');
  5. //修改变量值并输出
  6. $a=120;
  7. echo $a;
  8. echo('<br>');
  9. //定义常量并输出
  10. define('A','aaaaa');
  11. echo A;
  12. //函数中应用变量和常量
  13. function add()
  14. {
  15. echo('常量A的值为'.A.'<br>');
  16. printf('变量$a的值为d%',$a);
  17. }
  18. add();
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post