Skip to content

Commit 928bd03

Browse files
committed
Bug fix for tables without an ID
1 parent 1e10bd8 commit 928bd03

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/HTMLTable2JSON.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ public function tableToJSON($url, $firstColIsRowName = TRUE, $tableID = '', $ign
7272
else $html = $testing;
7373

7474
// Pull table out of HTML
75-
$table_str = '<table id="'.$tableID;
75+
if (strcmp('', $tableID))
76+
$table_str = '<table';
77+
else $table_str = '<table id="'.$tableID;
7678
$start_pos = stripos($html, $table_str);
7779
$end_pos = stripos($html, '</table>', $start_pos) + strlen('</table>');
7880
$length = $end_pos - $start_pos;

0 commit comments

Comments
 (0)