Rob, Daniel, it's a slippery slope: [link]
Buffistas Building a Better Board
Do you have problems, concerns or recommendations about the technical side of the Phoenix? Air them here. Compliments also welcome.
CRAP!
Okay, I broke it. Single quote/double quote.
Never mind, I seem to be able to delete.
Dudes. Finally got a moment: check out [link] which tests, in very mechanical fashion, for unclosed HTML tags.
For each start tag, there either is or isn't an end tag, found later in the text. That's all it does but after much messing around that seems to be what we need, really.
See if you can fool it, please?
And PHP gurus, what's the neat way to do:
$array2 = (all the values in $array1 which aren't empty strings)
once again I can't figure it out for myself.
You want array_filter
used with a callback function:
Like
function notblank($val) { return ($val<>"")};
$array2 = array_filter($array1, "notblank");
Standard typo and thinko disclaimers apply.
array_filter used with a callback function
You know what, I used that, and tried to do it with the built-in "empty" function, but it didn't seem to work with that, only the way you did it, where you write your own.
Not to get all Perl about it, but it doesn't have the pure poetry of:
@newarray = grep {length($_)} @oldarray;
does it?
Even ee might think your poetry a little opaque.
Even ee might think your poetry a little opaque.
I say "ee", you say "OO", let's call the whole thing off.
And of course like all Perl addicts I've realised I was way wordy above, goddamnit I'm Samuel Taylor Coleridge compared to the Japanese simplicity of this:
@newarray = grep {/./} @oldarray;
What was I thinking! If all I need is the output, I don't even need the new array:
print(grep(/./,@oldarray);
I distinctly recall John promising to use his powers only for good. This is not for good.