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

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

Guanhui
Release: 2020-06-18 10:30:24
Original
2367 people have browsed it

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 "没有子栏目";
}
Copy after login

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 "没有子栏目";
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template