Home > Backend Development > PHP Tutorial > php empty问题

php empty问题

WBOY
Release: 2016-06-23 14:35:07
Original
905 people have browsed it

昨天写PHP代码时为了方便写了一句if(empty(intval($type)))报错,提示“Can't use function return value in write context”,一时有点晕。就改成$type = intval($type) if(empty($type))最后查PHP手册说明empty()中的参数只能是变量。是否PHP可以改进下。上面这种写法也挺美的吧!

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