Home  >  Article  >  Backend Development  >  How does PHP determine that parameters cannot be empty?

How does PHP determine that parameters cannot be empty?

藏色散人
藏色散人Original
2020-11-09 13:48:312959browse

php method to determine whether the parameters cannot be empty: first create a PHP sample file; then use the "array_keys(array_map('trim', $data), '');" method and the if statement to determine whether the parameters are Just leave it empty.

How does PHP determine that parameters cannot be empty?

Recommended: "PHP Video Tutorial"

php batch judgment parameters cannot be empty

The code is as follows:

        //批量判断参数是否为空
        $arr = array_keys(array_map('trim', $data), '');
        if($arr) {
            echo '有参数为空';
        }
rrree

The above is the detailed content of How does PHP determine that parameters cannot be empty?. 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