<?php
$s1="";$s2="qwe";$s3="zxc";
if(!empty($s1))
{
$result=$s1;
}
else
{
if(!empty($s2))
{
$result=$s2;
}
else
{
$result=$s3;
}
}
echo "$result";
?>
Is there any possible code, probably of 1-2 lines, replacing the above mentioned code, I remember something like using “or” operator to do what I am doing with this code.
Or even shorter, if you have PHP >5.3:
More: PHP Manual part about Ternary Operator