Captain Paralytic wrote:
On 28 Jul, 14:15, Jeff <jeff@spam_me_n ot.comwrote:
> I have some custom tags I'm parsing, they look like this:
<edit name="some_valu e" name2="some_val ue" name3="value with spaces">
I had just been splitting on whitespace, until I though of the value
with whitespace already in it:
'/\s+/'
Is there a lightweight easy way to do this in PHP? In perl this is
neither easy and lightweight.
Jeff
How about removing the tag title and the trailing and splitting on
'/" /'?
Genius. I like that a lot.
I think I'll split on '/"\s+/'
What happens if this should occur?:
$key = '';
$key2 = ' A';
$ARRAY[$key] = 'some_val';
$ARRAY[$key2] = 'some_val';
From my code with $key2 it looks like the leading space is ignored as I
can retrieve this with: $ARRAY['A']. I'll run some more tests shortly as
I may be confused as that doesn't seem right.
Jeff