title: Printing array in parent-child relationship
body: <p>I have an array of task ids that I fetch from database using postgres stored procedure. Here is my array:</p>
  
  <pre><code>  $relationships=array(
              array(70),//This represents calculated hierarchy field in a record
              array(70, 71),//This represents calculated hierarchy field in a record
              array(70, 71, 72),//This represents calculated hierarchy field in a record
              array(70, 71, 72, 68)//This represents calculated hierarchy field in a record
          );
  </code></pre>
  
  <p>I want to print them in table of contents format to be able to create XML file for MS Project. </p>
  
  <p>This array should print indexes like this:</p>
  
  <pre><code>  $relationships=array(
              array(70),//Should print 1 because its grandparent task
              array(70, 71),//Should print 1.1 because its child of task 70
              array(70, 71, 72),//Should print 1.1.1 because its child of task 71
              array(70, 71, 72, 68)//Should print 1.1.1.1
          );
  </code></pre>
  
  <p>Any help?
  I have been stuck since two days. 
  Thanks</p>