I can’t understand what is wrong I am doing with this if else shorthand code
$item = '<li '. ($avatar_size > 50) ? .'style="overflow:hidden">';
I only want to check if condition true than add inline style else nothing.
Edit:
Of course in above statement it will remove > too when condition is false so I tried other statement but none of working. I am sure I must doing stupid mistake but can’t figure it out.
$item = '<li '. ($avatar_size > 50) ? .'style="overflow:hidden"'.:. '' .'>';
There is no “shorthand if”,
?:is an operator and it always must consist of?and:. The best you can do with this is: