I am working on a php file to extract tables from a website and rearrange them in a vertically stacked order of a single table.
I know a I need to develop a expression like preq_match() and use a maybe similar to /id=\"table1\" .+<tbody>(.+)<\/tbody>/s but am lost how to get started with my code as I am a beginner. Here is my code so far. I would appreciate any help.
<?php
$homepage = file_get_contents('http://www.cs.iusb.edu/people/faculty.html');
preg_match('id=\"table1\".+\<tbody\>(.+)\<\/tbody\>/s',$homepage,$array);
print_r($array);
?>