Trying to get data from this poorly created HTML format
http://www.weather.gov.sg/lws/zoneInfo.do
All I need is to get data for 3 places, e.g. Bedok, City and Katong. How do I store the data in an array for this?
This is what I did to get the store the first 5 lines, which is not exactly what I want.
$row_counter='0';
while($row_counter<5)
{
$ret['Name'][] = $html->find('.FORM1', $row_counter)->innertext;
$ret['Area'][] = $html->find('.FORM1', $row_counter)->next_sibling()->innertext;
$ret['Alert'][] = $html->find('.FORM1', $row_counter)->next_sibling()->next_sibling()->innertext;
$ret['From'][] = $html->find('.FORM1', $row_counter)->next_sibling()->next_sibling()->next_sibling()->innertext;
$ret['Till'][] = $html->find('.FORM1', $row_counter)->next_sibling()->next_sibling()->next_sibling()->next_sibling()->innertext;
$row_counter++;
}
I am able to store data successfully for the whole row and all columns. What is the most efficient way to search for a certain name, e.g. Bedok and getting the columns beside it like next_sibling?
Thanks.