Home > Backend Development > PHP Tutorial > dedeCMS 返回值有关问题

dedeCMS 返回值有关问题

WBOY
Release: 2016-06-13 11:08:40
Original
1018 people have browsed it

dedeCMS 返回值问题
我在DEDE,extend.func.php文件,写自定义函数

<br />function cn_substr0($str)<br />{<br />    return "0";<br />}
Copy after login


我想返回是'0'怎么DEDE老返回是空值呢,请教怎么解决dede返回0等于返回空值的问题呢?谢谢了
------解决方案--------------------
不可能为空啊~//is_null($res)===true
你测试改为别的呢,例如
return null;
return 123;
return "ABC";
多测几下你就看出来是调用方法不对还是判断条件问题
------解决方案--------------------
同意1楼的观点,建议输出一个别的值尝试一下。从来没返回过0,如果返回值为空,那就加一个if(!empty($str)){}判断

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