PHP如果X大于Y大于Z

时间:2014-10-31 08:03:58

标签: php if-statement

我正在尝试编写PHP IF语句的代码:

If X is greater than Y by more than Z

这可能吗?

我无法在'运营商'中找到任何内容。 WS3 Operators也不在其他内容中如果' PHP Else If还尝试了Google搜索php if x greater than y by more than z

2 个答案:

答案 0 :(得分:4)

我想你只是试着这样做:

if (($X - $Y) > $Z) {...}

答案 1 :(得分:1)

<?php 
//it will full fill your first condtion that `$x has to be greater than $y`
// and second one is well that `$x-$y` has to be greater than $z.
if(($x-$y)>$z)
{
    echo 'hurray';
}