I
I
ImPuuLsE2015-04-17 09:17:48
PHP
ImPuuLsE, 2015-04-17 09:17:48

How to parse tables with PHP Simple HTML DOM Parser?

Hello! there are tables with timetables navi.mostransavto.ru/?page=rasp&code=1220&ak=24&n=...
They are divided into direct flights and return flights. Stuck at stops over time.

$source = Parser::file_get_html('http://navi.mostransavto.ru/?page=rasp&code=1220&ak=24&n=1&com=');
        foreach($source->find('.shedule') as $tableN => $table){
                $tables[$tableN]['days'] = array_filter(explode('  ', $table->find('tr.stops', 0)->plaintext));
        }

I can't figure out how to add an array like: Where $station is the name of the stop And how can I separate the tables into Direct and Return flights...since they are obtained in one array.
$tables[$tableN]['stations'][$station]['time']

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question