original_string: public static function buildFromArray(&$html, $array, $tab = 0)
      {
          $pad = '';
          if ($tab > 0) {
              $pad = str_pad($pad, $tab * 2, ' ', STR_PAD_LEFT);
          }
  
          if (!isset($array[1])) {
              $html .= $array[0]."\n";
  
              return;
          }
  
          if (!empty($array[0])) {
              $html .= $pad;
              $html .= '<'.$array[0].$array[1].'>';
              $html .= "\n";
          }
  
          if (!empty($array[2])) {
              $html .= $pad.'  ';
              $html .= $array[2];
              $html .= "\n";
          }
  
          if (isset($array[3]) && is_array($array[3])) {
              foreach ($array[3] as $child_array) {
                  self::buildFromArray($html, $child_array, $tab + 1);
              }
          }
  
          if (!empty($array[0])) {
              $html .= $pad;
              $html .= '</'.$array[0].'>';
              $html .= "\n";
          }
      }
code: public static function buildFromArray(&$html, $array, $tab = 0)
      {
          $pad = '';
          if ($tab > 0) {
              $pad = str_pad($pad, $tab * 2, ' ', STR_PAD_LEFT);
          }
  
          if (!isset($array[1])) {
              $html .= $array[0]."\n";
  
              return;
          }
  
          if (!empty($array[0])) {
              $html .= $pad;
              $html .= '<'.$array[0].$array[1].'>';
              $html .= "\n";
          }
  
          if (!empty($array[2])) {
              $html .= $pad.'  ';
              $html .= $array[2];
              $html .= "\n";
          }
  
          if (isset($array[3]) && is_array($array[3])) {
              foreach ($array[3] as $child_array) {
                  self::buildFromArray($html, $child_array, $tab + 1);
              }
          }
  
          if (!empty($array[0])) {
              $html .= $pad;
              $html .= '</'.$array[0].'>';
              $html .= "\n";
          }
      }
code_tokens: public static function buildFromArray ( & $ html , $ array , $ tab = 0 ) { $ pad = '' ; if ( $ tab > 0 ) { $ pad = str_pad ( $ pad , $ tab * 2 , ' ' , STR_PAD_LEFT ) ; } if ( ! isset ( $ array [ 1 ] ) ) { $ html .= $ array [ 0 ] . "\n" ; return ; } if ( ! empty ( $ array [ 0 ] ) ) { $ html .= $ pad ; $ html .= '<' . $ array [ 0 ] . $ array [ 1 ] . '>' ; $ html .= "\n" ; } if ( ! empty ( $ array [ 2 ] ) ) { $ html .= $ pad . '  ' ; $ html .= $ array [ 2 ] ; $ html .= "\n" ; } if ( isset ( $ array [ 3 ] ) && is_array ( $ array [ 3 ] ) ) { foreach ( $ array [ 3 ] as $ child_array ) { self :: buildFromArray ( $ html , $ child_array , $ tab + 1 ) ; } } if ( ! empty ( $ array [ 0 ] ) ) { $ html .= $ pad ; $ html .= '</' . $ array [ 0 ] . '>' ; $ html .= "\n" ; } }
docstring: Build html from an array.
  
  @param string &$html
  @param array  $array
  @param int    $tab
  
  @return void
docstring_tokens: Build html from an array .