检查PHP的Empty()时出错 [英] Error checking Empty() for PHP
本文介绍了检查PHP的Empty()时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是我正在尝试使用的代码。
Below is my piece of code that i am trying to work with.
<?php if (empty(userphoto($curauth))){echo "<img src='http://localhost/wordpress/wp-content/uploads/2013/01/NoImage.png' /?>"} else { userphoto($curauth)} ?>
我正在检查userphoto($ curauth)是否为空,我用默认图像替换它。
每次我这样做,我得到以下错误。
致命错误:在写入上下文中不能使用函数返回值...
有人可以指导我到底是什么问题吗?
I am checking if userphoto($curauth) is null, i am replacing it with a default image.
Everytime i do this, i get the below error.
"Fatal error: Can''t use function return value in write context in..."
Can someome guide me what is the problem exactly?
推荐答案
curauth))){echo < img src ='http:// l ocalhost / wordpress / wp-content / uploads / 2013/01 / NoImage.png'/?>} else {userphoto(
curauth))){echo "<img src='http://localhost/wordpress/wp-content/uploads/2013/01/NoImage.png' /?>"} else { userphoto(
curauth)} ?>
curauth)} ?>
我正在检查userphoto(
I am checking if userphoto(
curauth)是否为空,我将其替换为默认图像。
每次我做这个,我得到以下错误。
致命错误:在写入上下文中不能使用函数返回值...
有人可以指导我到底是什么问题吗?
curauth) is null, i am replacing it with a default image.
Everytime i do this, i get the below error.
"Fatal error: Can''t use function return value in write context in..."
Can someome guide me what is the problem exactly?
这篇关于检查PHP的Empty()时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文