I\'ve perused the questions on ternary operators vs. if/else structures, and while I understand that under normal circumstances there is no performance los
In this cases, I use the form presented by BoltClock:
if (strlen($foo) > 3) { $foo = substr($foo, 0, 3); }
PHP does not implement something more simple to work in this cases, yet :/