create an array from a text file or another array that is based on tabbed spaces?
<p>What I am ultimately trying to do is take a text file that looks like below and organize them into something I can use like an array based on tabbed spaces. </p>

<p>// Example //</p>

<pre><code>this is no tabbed space
     this is a tabbed space
          this is 2 tabbed spaces
this is no tabbed space 
</code></pre>

<p>I would like to end up with:(using PHP preferably)</p>

<pre><code>$list= array(no \t("string", "string", "string", one \t ("string", "string", "string", 
tw0 \t("string", "string", "string", etc..)),

no \t again starts new("string", "string", array());
</code></pre>

<p>I need to keep nesting based on \t spaces and start over when I hit no \t space.
Any suggestions or better ways to do this?</p>

<p>I need to use this list from a text file to insert into database as categories and use for menu items that have sub levels and as many needed depending on the text file.</p>

<p>I figured out how to get them into one array but is there a way to organize them by the tabbed spaces or maybe by if greater than a certain amount of spaces etc..? I am just confused at this piont been trying many different ways but I am truly lost.</p>
