I have a variable that’s created from a file_read_contents() before being created into an array using explode(). From there, I threw it into a FOREACH where I’m trying to use a condition that says “IF SPACE FOUND, DISREGARD” and as usual, it’s not working.
Basically, I want to avoid outputting any list-item (<LI></LI>) if what’s to be contained within, in essence, is blank. For example, right now, it’s producing a final list-item at the end that has nothing in it (true, it is an empty string–so there IS something inside it, but for all intents and purposes, it’s pragmatically blank or nothingness). So to that end, I believe that it’s a new-line character that’s causing this. The empty string consists of 1 character-long data and I had thought that trying to target ‘’ would trip the condition but it’s not…
Both empty and [url=http://php.net/array_filter]array_filter* would eliminate more than “just spaces”. Admittedly, the only real trouble would be with lines containing (only) a zero character (0) but even that is more than just space.