title: Get 2 contents per line
body: <p>I was wondering I can get these to the ID and the Name from this code:</p>
  
  <pre><code>    stuffyd[1] = {name: "Item 1"};
  stuffyd[2] = {name: "Item 2"};
  stuffyd[3] = {name: "Item 3"};
  stuffyd[4] = {name: "Item 4"};
  stuffyd[5] = {name: "Item 5"};
  stuffyd[6] = {name: "Item 6"};
  </code></pre>
  
  <p>The ID is in the [IDHERE] and the name, obviously is after name:
  I tried using explode and loops but that didn't work out well. Here was my code:</p>
  
  <pre><code>    &lt;?php
  function getItemName($i) {
      $itemNameFile = file_get_contents('test.txt');
      $itemName = explode('"', $itemNameFile);
      return $itemName[$i];
  }
  function getItemID($i) {
      $itemIDFile = file_get_contents('test.txt');
      $itemID1 = explode('stuffyd[', $itemIDFile);
      $itemID = explode(']', $itemID1[$i]);
      return $itemID[0];
  }
  function getNamesID() {
      for($i = 1; $i &lt; 6; $i++) {
          //if ($i &amp; 1) {
              $itemName1 = getItemName($i);
          //}
          //if($i &lt; 6) {
              $itemID1 = getItemID($i);
          //}
      }
      echo $itemName1 . ":" . $itemID1 . chr(10);
  }
  getNamesID();
  ?&gt;
  </code></pre>
  
  <p>This is the output: 
  Item 3:5</p>
  
  <p>What can I do?</p>