Home  >  Article  >  CMS Tutorial  >  How does PHPCMS determine whether the column contains sub-columns?

How does PHPCMS determine whether the column contains sub-columns?

Guanhui
GuanhuiOriginal
2020-06-18 10:30:242322browse

How does PHPCMS determine whether the column contains sub-columns?

PHPCMS How to determine whether this column contains sub-columns?

1. Directly determine "child" in the data of this column. If it is true, it contains sub-columns;

if ($cate['child']) {
    echo "有子栏目";
} else {
    echo "没有子栏目";
}

2. First determine whether the data exists, and if it exists, then determine whether Is empty, if both are true, it contains sub-columns.

if (isset($cate['child']) && !empty($cate['child'])) {
    echo "有子栏目";
} else {
    echo "没有子栏目";
}

Recommended tutorial: "PHPCMS Tutorial"

The above is the detailed content of How does PHPCMS determine whether the column contains sub-columns?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn