Hi, all.
Been staring at this for a couple of hours now and I find myself
completely bewildered. I suppose it doesn't help that I'm a php newbie.
Nevertheless, I throw myself at your mercy.
I have an array which I am attempting to split off into a new array.
The first array is just a whole bunch of links like so:
I managed to (sorta) successfully extract things out using preg_split:
foreach ($http_array as $i) {
$split = preg_split("/=/", $i, 2);
print "$split[1]<br>";
}
and the output looks like
.... and so on...
The main goal is to parse an array much like the first bit at the top,
lop off anything after the first "=" in the line and then place it all
into another blank array so that I might do something else clever
elsewhere with it.
however, i've been totally unsuccessful in cleaning out blank entries
in the array (some creep in there, PREG_SPLIT_NO_E MPTY does not seem to
catch them) and cramming all of that into another new array. Been back
and forth between google and the fine php documents with little to show
for it.
eh. I give up. thoughts?
tom
Been staring at this for a couple of hours now and I find myself
completely bewildered. I suppose it doesn't help that I'm a php newbie.
Nevertheless, I throw myself at your mercy.
I have an array which I am attempting to split off into a new array.
The first array is just a whole bunch of links like so:
I managed to (sorta) successfully extract things out using preg_split:
foreach ($http_array as $i) {
$split = preg_split("/=/", $i, 2);
print "$split[1]<br>";
}
and the output looks like
.... and so on...
The main goal is to parse an array much like the first bit at the top,
lop off anything after the first "=" in the line and then place it all
into another blank array so that I might do something else clever
elsewhere with it.
however, i've been totally unsuccessful in cleaning out blank entries
in the array (some creep in there, PREG_SPLIT_NO_E MPTY does not seem to
catch them) and cramming all of that into another new array. Been back
and forth between google and the fine php documents with little to show
for it.
eh. I give up. thoughts?
tom
Comment