title: php recursion - notice: undefined offset: 20 array
body: <p>I'm working to parse the following string but at the same time trying to get rid of the current undefined offset on the index array. I would appreciate some help w/ the undefined offset issue.</p>
  
  <pre><code>error_reporting(E_ALL);
  ini_set('display_errors', '1');
  function my_recursion($String, &amp;$Inc) {
      $l = strlen($String);
      $has_quotes = 0; $array = array();
      $x= 0;  
      for ($Inc; $Inc &lt; $l; $Inc++) {
          $my_char = $String[$Inc];
          if ($my_char == '(' &amp;&amp; !$has_quotes) {
              $Inc++;
              $array[$x] = my_recursion($String, $Inc);
              $x++;
          } else if ($my_char == '"') {
              $has_quotes = !$has_quotes;
              if (!$has_quotes)
                  $x++;
          } else if ($has_quotes) {
              $array[$x] .= $my_char;
          }   
      }   
      print_r($array);
  }
  $String = '(("HELLO"("BAR")("FOO")()""))';
  $Inc = 0;
  (my_recursion($String, $Inc));
  </code></pre>