开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜