php echo如果两个条件为真 [英] php echo if two conditions are true

查看:128
本文介绍了php echo如果两个条件为真的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际代码如下所示:

if (file_exists($filename)) {echo $player;

} else { 

echo 'something';

但即使没有从网址调用id

but it displays the player even if the id is not called from the url

我需要这样的东西:

check if $filename exists and $id it is not empty then echo $player

if else echo something else

我检查是否

if(empty($id)) echo "text";

但我不知道如何将两者结合起来

but i don't know how to combine both of them

有人可以帮助我吗?

感谢您提供所有代码示例,但我仍有问题:

Thank you for all your code examples but i still have a problem:

我如何检查$ id 是否为空然后回显其余代码

How i check if $id is not empty then echo the rest of code

推荐答案

if (!empty($id) && file_exists($filename))

这篇关于php echo如果两个条件为真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆