I was looking through some js code one day when I noticed that it did something like this:
Code: Select all
a=a||documentCode: Select all
if(a){
a=a;
}else{
a=document;
}So,would something like this work?
Code: Select all
$var=$_POST['var1'] || 'default string';Code: Select all
$var=isset($_POST['var1']) && $_POST['var1'];