WARNING!!!!
Let's say, we have this little script:
<?php
$username = 'Me';
$guestusername = 'Guest';
echo 'Hello, ' . isset($i) ? 'my friend: ' . $username . ', how are you doing?' : 'my guest, ' . $guestusername . ', please register';
?>
What you want:
If $i is set, display:
Hello, my friend: Me, how are you doing?
If not, display:
Hello, my guest, Guest, please register
BUT, you DON'T get that result!
If $i is set, you get this:
my friend: Me, how are you doing? (so, there's not "Hello, " before it)
If $i is NOT set, you get this:
my friend: Me, how are you doing?
So... That's the same!
You can solve this by using the "(" and ")" to give priority to the ternary operator:
<?php
$username = 'Me';
$guestusername = 'Guest';
echo 'Hello, ' . (isset($i) ? 'my friend: ' . $username . ', how are you doing?' : 'my guest, ' . $guestusername . ', please register');
?>
When $i is set, you get this:
Hello, my friend: Me, how are you doing? (expected)
When $i is NOT set, you get this:
Hello, my guest, Guest, please register (expected too)
So.. Please, don't be dumb and ALWAYS use the priority-signs (or.. How do you call them?), ( and ).
By using them, you won't get unneeded trouble and always know for sure your code is doing what you want: The right thing.