Nth occurrence of word - pull single table out of HTML with a bunch of tables
3rd party generated HTML (Purchase Order) was rife with errors, so direct import was impossible.
Decided to pull the particular table out of the HTML attachment, and then wrap that as "new" HTML for import into DOMDocument.
PHP code:
preg_match('/^(?:(?:(?!table).)*table){19}(.+?(?=table))/is', $ra...
Submitted by Christopher Cilley - 8 years ago