I need to take this "something.blah.com/test/lack/123/56CS"
and trying to
explode by forward slash
then I am trying to save it into XML format for Excel
$path_explode = explode("/", $path);
foreach($path_explode as $key => $value) {
echo " <Cell><Data ss:Type=\"String\">" . $value . "</Data></Cell>\n\r";
}
my output ends up being this
<Cell><Data ss:Type="String">something.blah.com</Data></Cell>
<Cell><Data ss:Type="String">test</Data></Cell>
<Cell><Data ss:Type="String">lack</Data></Cell>
<Cell><Data ss:Type="String">123</Data></Cell>
</Data></Cell>ta ss:Type="String">56CS
The last value ends up messing up, I believe its because the last character doesnt having a trailing slash.
So I try adding it, and it still messes up.
Ive even tried counting the number of items in the $path_explode array, and then
if ($key == $count){ }//dont echo
ive also tried count -1, -2
I have tried multiple versions of 5.2.* to see if it was a bug, but still have the same problem
Please anyone can point me in the right direction, I am loosing my mind.