original_string: public static function loopEncode($data, array $parent = array())
      {
          $resultString = '';
          foreach ($data as $key => $value) {
              if (is_array($value)) {
                  //subsection case
                  //merge all the sections into one array...
                  $sec = array_merge((array) $parent, (array) $key);
                  //add section information to the output
                  $resultString .= PHP_EOL . '[' . join('.', $sec) . ']' . PHP_EOL;
                  //recursively traverse deeper
                  $resultString .= self::loopEncode($value, $sec);
              } else {
                  $resultString .= "$key = $value" . PHP_EOL;
              }
          }
  
          return $resultString;
      }
code: public static function loopEncode($data, array $parent = array())
      {
          $resultString = '';
          foreach ($data as $key => $value) {
              if (is_array($value)) {
                  //subsection case
                  //merge all the sections into one array...
                  $sec = array_merge((array) $parent, (array) $key);
                  //add section information to the output
                  $resultString .= PHP_EOL . '[' . join('.', $sec) . ']' . PHP_EOL;
                  //recursively traverse deeper
                  $resultString .= self::loopEncode($value, $sec);
              } else {
                  $resultString .= "$key = $value" . PHP_EOL;
              }
          }
  
          return $resultString;
      }
code_tokens: public static function loopEncode ( $ data , array $ parent = array ( ) ) { $ resultString = '' ; foreach ( $ data as $ key => $ value ) { if ( is_array ( $ value ) ) { //subsection case //merge all the sections into one array... $ sec = array_merge ( ( array ) $ parent , ( array ) $ key ) ; //add section information to the output $ resultString .= PHP_EOL . '[' . join ( '.' , $ sec ) . ']' . PHP_EOL ; //recursively traverse deeper $ resultString .= self :: loopEncode ( $ value , $ sec ) ; } else { $ resultString .= "$key = $value" . PHP_EOL ; } } return $ resultString ; }
docstring: Method to look the data and encode it to ini format
  @param  array $data   Data to encode
  @param  array $parent Parent array, in case of recursive arrays
  @return string
docstring_tokens: Method to look the data and encode it to ini format