在下面的 If.. else 语句中,我想先看看是否有第四个面包屑(URI 数组 4),然后看看它是否是一个数字。
但两者总是返回真、数字、字母或空..
谁能告诉我为什么?
// checks the third breadcrumb contained within the breadcrumbs class to see
// if it is an article. Then uses a recursive function to search the first
// and second breadcrumbs to see if they exist within their respective menu
// arrays. finally, if that validates, then the fourth breadcrumb is checked
// to see if it exists (not empty) AND if it is a number.
else
if (($this->breadcrumbs->getCrumb(3)=='article' &&
$array_helper->recValueReturn($this->breadcrumbs->getCrumb(2),
$this->getNavTwo()) &&
$array_helper->recValueReturn($this->breadcrumbs->getCrumb(1),
$this->getNavOne())) || ($this->breadcrumbs->getCrumb(4)) &&
is_numeric($this->breadcrumbs->getCrumb(4))) {
...
以下始终验证为 False:
else
if (($this->breadcrumbs->getCrumb(3)=='article'&&
$array_helper->recValueReturn($this->breadcrumbs->getCrumb(2),
$this->getNavTwo()) &&
$array_helper->recValueReturn($this->breadcrumbs->getCrumb(1),
$this->getNavOne())) &&
(array_key_exists($this->breadcrumbs->getCrumb(4),
$this->breadcrumbs->getCrumbs())&&
is_numeric($this->breadcrumbs->getCrumb(4)))) {
...