And if that's the case, you're missing the <br /> tag that signals a line break in HTML. If I remember correctly, implicit line breaks like the ones above turn into spaces when HTML is rendered on to a webpage.
So, if this is your problem, try replacing the spaces with "<br />" instead of newlines.
This already prints file names separated/delimited by "\n", but then you assign this output to a variable, where AFAIK all "\n" get converted to a whitespace. Later you actually do the same with another variable.
Why not simply redirect the output of the find command to a file?
Hi pseudocoder. Not exactly. It is the other way around. When you assign the output to a variable, the newline characters are retained. If you later echo that variable without quotation they are converted to spaces. If you echo the variable with quotation the newline characters are not converted to spaces.
or something of the kind. The exact formatting is not critical, but that it be correct html or xhtml to display properly when written to the html page and rendered in a browser does!
Check into other options, like wrapping it in
tags as another option.
(Note, you can load the variable as you did, then parse and format it on output. This was just one example.)