Hello so I have a piece of code:
if($request['txt_!'] != "") {
$randl1_1 = mt_rand(100000, 999999);
} else {
$randl1_1 = '';
}
And when I convert it to a ternary operator:
$randl1_1 = ($request['txt_1'] != "") ? mt_rand(100000, 999999) : '';
What if I will add some in my if? Like,
if($request['txt_!'] != "") {
$randl1_1 = mt_rand(100000, 999999);
someFunction();
} else {
$randl1_1 = '';
}
Is it possible in a ternary operator?