Hello,
This is my first post an I am hoping someone can help me with and pretty easy request...
Here is my issue...
I am trying to create a data feed from a shopping cart. I need to create a CSV for the feed and I have everything complete but the nesting of the categories. I have the values in an array but need to have some additional deliminators added based on the length of the array.
Here are the details...
I am only going three layers deep and deliminating with a pipe '|', thus the array can return...
Level one|
Level one|Level two|
Level one|Level two|Level three|
What i need to maintain the structural in the resulting CSV is...
IF Level one only then add '|' . '|'; (two pipes) -- top level
IF Level one|Level two| then add '|'; (one pipe) -- 2nd level
Level one|Level two|Level three then no pipe required -- 3rd level
Example output of array....
top|
top|product|
top|product|model|
Desired output...
top|||
top|product||
top|product|model|
NOTE: Pipes "|"
Thanks