变量前面的exclamaton标记是什么意思?它在这段代码中如何使用?
编辑:从迄今为止的答案我怀疑我也应该提到,这段代码是在一个函数中,其中一个参数是$ mytype ....这是检查$ mytype是否通过检查的方式吗? - 感谢所有响应者。
$myclass = null;
if ($mytype == null && ($PAGE->pagetype <> 'site-index' && $PAGE->pagetype <>'admin-index')) {
return $myclass;
}
elseif ($mytype == null && ($PAGE->pagetype == 'site-index' || $PAGE->pagetype =='admin-index')) {
$myclass = ' active_tree_node';
return $myclass;
}
elseif (!$mytype == null && ($PAGE->pagetype == 'site-index' || $PAGE->pagetype =='admin-index')) {
return $myclass;
}`
这正是我的想法!我张贴是因为我想知道是否有其他原因。我会给它几天的时间来看看它是否会出现一些极端泄露的PHP怪癖或我的主要误解。 – DogBot