You want simpler, STOP USING DOUBLE QUOTES ON PHP STRINGS!
… and you can get the spaces to show with a hint of CSS without the container going block-level using white-space: pre, though really PRE by itself should be enough to do what you want.
Using single quotes also means white space in the output is preserved, and it only needs ONE echo statement… and the presence of <pre> means your carriage returns show up on the page.