echo strlen('Hello World') > 2 ? '...' : '' . substr('Hello World',0,2);
above code output:
...
what I except was
...He
Can anyone explain how the above code is evaluated in php
EDIT
echo substr('Hello World',0,2) . strlen('Hello World') > 2 ? '...' : '';
OUTPUT
NO OUTPUT
BUT this works
echo substr('Hello World',0,2), strlen('Hello World') > 2 ? '...' : '';
OUTPUT
He...