src/Support/Parser.php
public static function schedule($body, $selector = '#Table1')
    {
        $array = [];

        $crawler = $body instanceof Crawler ? $body : new Crawler((string)$body);
        // to array
        $crawler->filter($selector)->children()->each(function (Crawler $node, $i) use (&$array) {
            // 删除前两行
            if ($i < 2) {
                return false;
            }
            $array[] = $node->children()->each(function (Crawler $node, $j) {
                $span = (int)$node->attr('rowspan') ?: 0;

                return [$node->html(), $span];
            });
        });

        // If there are some classes in the table is in two or more lines,
        // insert it into the next lines in $array.
        $lineCount = count($array);
        $schedule = [];
        for ($i = 0; $i < $lineCount; $i++) {  // lines
            for ($j = 0; $j < 9; $j++) {    // rows
                if (isset($array[$i][$j])) {
                    $k = $array[$i][$j][1];
                    while (--$k > 0) { // insert element to next line
                        // Set the span 0
                        $array[$i][$j][1] = 0;
                        $array[$i + $k] = array_merge(
                            array_slice($array[$i + $k], 0, $j),
                            [$array[$i][$j]],
                            array_splice($array[$i + $k], $j)
                        );
                    }
                }
                $schedule[$i][$j] = isset($array[$i][$j][0]) ? $array[$i][$j][0] : '';
            }
        }

        return $schedule;
    }
public static function schedule($body, $selector = '#Table1')
    {
        $array = [];

        $crawler = $body instanceof Crawler ? $body : new Crawler((string)$body);
        // to array
        $crawler->filter($selector)->children()->each(function (Crawler $node, $i) use (&$array) {
            // 删除前两行
            if ($i < 2) {
                return false;
            }
            $array[] = $node->children()->each(function (Crawler $node, $j) {
                $span = (int)$node->attr('rowspan') ?: 0;

                return [$node->html(), $span];
            });
        });

        // If there are some classes in the table is in two or more lines,
        // insert it into the next lines in $array.
        $lineCount = count($array);
        $schedule = [];
        for ($i = 0; $i < $lineCount; $i++) {  // lines
            for ($j = 0; $j < 9; $j++) {    // rows
                if (isset($array[$i][$j])) {
                    $k = $array[$i][$j][1];
                    while (--$k > 0) { // insert element to next line
                        // Set the span 0
                        $array[$i][$j][1] = 0;
                        $array[$i + $k] = array_merge(
                            array_slice($array[$i + $k], 0, $j),
                            [$array[$i][$j]],
                            array_splice($array[$i + $k], $j)
                        );
                    }
                }
                $schedule[$i][$j] = isset($array[$i][$j][0]) ? $array[$i][$j][0] : '';
            }
        }

        return $schedule;
    }
public static function schedule ( $ body , $ selector = '#Table1' ) { $ array = [ ] ; $ crawler = $ body instanceof Crawler ? $ body : new Crawler ( ( string ) $ body ) ; // to array $ crawler -> filter ( $ selector ) -> children ( ) -> each ( function ( Crawler $ node , $ i ) use ( & $ array ) { // 删除前两行 if ( $ i < 2 ) { return false ; } $ array [ ] = $ node -> children ( ) -> each ( function ( Crawler $ node , $ j ) { $ span = ( int ) $ node -> attr ( 'rowspan' ) ? : 0 ; return [ $ node -> html ( ) , $ span ] ; } ) ; } ) ; // If there are some classes in the table is in two or more lines, // insert it into the next lines in $array. $ lineCount = count ( $ array ) ; $ schedule = [ ] ; for ( $ i = 0 ; $ i < $ lineCount ; $ i ++ ) { // lines for ( $ j = 0 ; $ j < 9 ; $ j ++ ) { // rows if ( isset ( $ array [ $ i ] [ $ j ] ) ) { $ k = $ array [ $ i ] [ $ j ] [ 1 ] ; while ( -- $ k > 0 ) { // insert element to next line // Set the span 0 $ array [ $ i ] [ $ j ] [ 1 ] = 0 ; $ array [ $ i + $ k ] = array_merge ( array_slice ( $ array [ $ i + $ k ] , 0 , $ j ) , [ $ array [ $ i ] [ $ j ] ] , array_splice ( $ array [ $ i + $ k ] , $ j ) ) ; } } $ schedule [ $ i ] [ $ j ] = isset ( $ array [ $ i ] [ $ j ] [ 0 ] ) ? $ array [ $ i ] [ $ j ] [ 0 ] : '' ; } } return $ schedule ; }
Parser the schedule data.

@param string|Crawler $body
@param string         $selector

@return array
Parser the schedule data .