in php i need one line if condition for time compare
<p>i have to value</p>

<pre><code> $mo=strtotime($input_array['MondayOpen']);
 $mc=strtotime($input_array['MondayClose']);
</code></pre>

<p>now i need a if condition to display an error on below conditions</p>

<ol>
<li>if one of them($mo or $mc) are empty, null or blank.</li>
<li>if close time($mc) is less than open time($mo)</li>
</ol>

<p>means if both are empty(null) or $mc>$mo then go further</p>

<p>please suggest optimized one line if condition for this</p>

<p>i know it seems very basic question, but i m facing problem when both are null
either i was using simple</p>

<pre><code>if(($mo==NULL &amp;&amp; $mc!=NULL) || ( $mo&gt;=$mc &amp;&amp; ($mo!=NULL &amp;&amp; $mc!=NULL))  )
</code></pre>
