Home > Backend Development > PHP Tutorial > An idea about defining methods in PHP

An idea about defining methods in PHP

WBOY
Release: 2016-08-08 09:25:17
Original
922 people have browsed it

The general format when defining methods in php is function foo( arg1, arg2. . )
Written in the format
function foo(arg1=fal se, sscccarg2. if($arg1 == true){
Execution condition 1
}
}

When the first $arg1 = false, it means when arg1 has no passed value,

The second one

arg1 ==truewhen, refers to iswhen( arg1 = false) is true Personally, this is an idea of ​​how to write

The above introduces an idea of ​​defining methods in PHP, including aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template