To echo or not to echo?

The main differences are: the first snippet has html inside php while the second one has php inside html. Both approaches are basically valid, both are fine.

I would however always prefer (and recommend) to have php inside html because chances are that a third person / designer might have less difficulties in understanding the code and i.m.h.o. it is less likely to mess with it.