This doesn't work as expected due to a bug in the PHP language grammar, as seen at: http://en.wikipedia.org/wiki/%3F:#PHP
Here's a simple version that DOES work:
$transport = 'T';
$vehicle = (
( $transport == 'B' ? 'bus' :
( $transport == 'A' ? 'airplane' :
( $transport == 'T' ? 'train' :
( $transport == 'C' ? 'car' :
( $transport == 'H' ? 'horse' :
'feet' ))))));
echo $vehicle;
But as everyone else said, I agree this isn't the best way to do this. You could use a switch case, if else if, or associative array and be a lot more readable.