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 ;)
精彩评论