The example in this article describes the usage of define in php. Share it with everyone for your reference. The details are as follows:
<?php /* * define * */ /*第3个参数: * false -- 对大小写敏感(默认) * true -- 对大小写不敏感 * */ define("pai",3.14); define ("name","LiLei",true); function testfor($x) { for($a=$x;$a<=12;$a++) { echo "现在是$a 点:"; if($a<9) { echo "敲代码"; echo name; } else { echo "睡觉"; echo pai; } echo "<br />"; } } testfor(10); ?>
The running results are as follows:
It is now 10 o'clock: Go to bed 3.14
It is now 11 o'clock: Go to bed 3.14
It is now 12 o'clock: Go to bed 3.14
I hope this article will be helpful to everyone’s PHP programming.
For more articles related to define usage examples in PHP, please pay attention to the PHP Chinese website!