开发者

What to do if the parameter of a function is not defined? (PHP)

开发者 https://www.devze.com 2023-04-06 00:13 出处:网络
I have static function getQuery(isset(开发者_如何学Go$var)?$var:$var=\"no\") which does not work.

I have static function getQuery(isset(开发者_如何学Go$var)?$var:$var="no") which does not work.

I want to use it either by DoDb::getQuery(); or DoDb::getQuery($var); depending on the necessities.


static function getQuery($var="no")


Look at this page http://tuxradar.com/practicalphp/4/15/5. This is the same in many language ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消