Re: UNLESS Statement Equivalent

From: Date: Mon, 11 Mar 2013 23:03:47 +0000
Subject: Re: UNLESS Statement Equivalent
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-320475@lists.php.net to get a copy of this message
On Mar 11, 2013, at 3:47 PM, Ashley Sheridan wrote: > if ( !( ($current_page == $saved_page) and ($current_ip == $saved_ip) and ($current_dt < > ($saved_dt + 3600)) ) ) Hello Ash, This makes sense to me, but I can't get it to work, so I'm either not understanding it or I'm asking the wrong question. Here's a complete scriptlet: <?php $saved_page = 'ddd'; $page = 'ddd'; $saved_ip = '1.1.1.1'; $ip = '1.1.1.1'; $saved_dt = '2013-03-11 11:11:11'; $current_dt = '2013-03-11 11:22:11'; if ( !( ($current_page == $saved_page) and ($current_ip == $saved_ip) and ($current_dt < ($saved_dt + 3600)) ) ) { echo 'Save results.'; } else { echo "Don't save."; } ?> Using the supplied data, the result should be "Don't save." Can you see what's wrong? Angela

« previous php.general (#320475) next »