Home >Backend Development >PHP Tutorial >Examples of define usage in php, phpdefine usage examples_PHP tutorial

Examples of define usage in php, phpdefine usage examples_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:45:331309browse

Examples of define usage in php, phpdefine usage examples

The examples in this article describe the usage of define in php. Share it with everyone for your reference. The details are as follows:

<&#63;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);
&#63;>

The running results are as follows:

It’s 10 o’clock now: bed 3.14
It’s 11 o’clock now: bed 3.14
It’s 12 o’clock now: bed 3.14

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1040812.htmlTechArticleExamples of define usage in php, phpdefine usage examples This article describes the use of define in php. Share it with everyone for your reference. The details are as follows: php/* * define * */ /*The third parameter: *...
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