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

An idea about defining methods in PHP

WBOY
WBOYOriginal
2016-08-08 09:25:17900browse

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.

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