Home  >  Article  >  Backend Development  >  php内嵌函数用法实例,php内嵌实例_PHP教程

php内嵌函数用法实例,php内嵌实例_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:02:061053browse

php内嵌函数用法实例,php内嵌实例

本文实例讲述了php内嵌函数用法。分享给大家供大家参考。具体分析如下:

php中可以在函数内部内嵌一个函数,调用范围仅限于函数本身

<&#63;php
function msg()
{
  echo("<center><h2>Displaying even
  numbers</h2></center><p><p>");
  function displayeven()
  {
   $ctr=0;
   echo("<font size=4>");
   for($i=2;$i<=100;$i+=2)
   {
     echo("$i    ");
     $ctr++;
     if($ctr%10==0)
     {
      echo("<p>");
     }
   }
   echo("</font>");
  }
}
msg();
displayeven();
&#63;>

希望本文所述对大家的php程序设计有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/970982.htmlTechArticlephp内嵌函数用法实例,php内嵌实例 本文实例讲述了php内嵌函数用法。分享给大家供大家参考。具体分析如下: php中可以在函数内部内嵌一...
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