$var = $input || 'default' in PHP
<p>Sorry if the title isn't clear enough, but in Javascript you can do this :</p>

<pre><code>var input = null;
var fruit = input || 'default';
</code></pre>

<p>Just wondering if PHP supports that kind of checking, currently I'm using :</p>

<p>$fruit = !empty($input)?$input : 'default' ;</p>

<p>Which is quite good, but of course the Javascript method is more elegant.</p>

<p>Thanks</p>
