Home  >  Article  >  Backend Development  >  PHP built-in function usage example code

PHP built-in function usage example code

怪我咯
怪我咯Original
2017-07-12 16:43:291136browse

The so-called PHP built-in functions are functions that have been defined in the library of the PHP program, such as echo, mysql_connect, include_once, etc., just like VC++ The system functions inside are the same, such as cout, etc.

This article mainly introduces the usage of phpembeddedfunctions, and analyzes the calling methods and usage techniques of php embedded functions with examples, which has certain reference value. Friends in need can refer to it. The specific analysis is as follows:

In php, a function can be embedded inside the function, and the calling scope is limited to the function itself

<?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();
?>

The above is the detailed content of PHP built-in function usage example code. For more information, please follow other related articles on the PHP Chinese website!

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