Home  >  Article  >  Backend Development  >  PHP built-in function usage examples_PHP tutorial

PHP built-in function usage examples_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:01:161083browse

Examples of usage of php built-in functions

This article mainly introduces the usage of php built-in functions. The examples analyze the calling methods and usage techniques of php built-in functions, which has certain reference For reference value, friends in need can refer to it

The examples in this article describe the usage of PHP built-in functions. Share it with everyone for your reference. The specific analysis is as follows:

In PHP, you can embed a function inside the function, and the calling scope is limited to the function itself

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

function msg()

{

echo("

Displaying even

numbers

");

function displayeven()

{

$ctr=0;

echo("");

for($i=2;$i<=100;$i =2)

{

echo("$i ");

$ctr ;

if($ctr==0)

{

echo("

");

}

}

echo("");

}

}

msg();

displayeven();

?>

1 2

3

4 5

67 8 9 10 11 12
13
14
15 16 17 18 19 20 21 22 23 24
<🎜>function msg()<🎜> <🎜>{<🎜> <🎜>echo("

Displaying even numbers

"); function displayeven() { $ctr=0; echo(""); for($i=2;$i<=100;$i =2) { echo("$i "); $ctr ; if($ctr ==0) { echo("

"); } } echo(""); } } msg(); displayeven(); ?>

I hope this article will be helpful to everyone’s PHP programming design. http://www.bkjia.com/PHPjc/971957.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/971957.htmlTechArticlePHP embedded function usage examples This article mainly introduces the usage of php built-in functions and analyzes the php built-in functions with examples. The function calling method and usage skills have certain reference value. Friends who need it...
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