Scraping data from National weather services

Although parsing html with a regex is usually a very bad idea, the error you are receiving, is caused by the / character. You are using that character as the delimiter for your pattern, so you need to escape it or use another character:

$regex = '/<td>(.+?) <\/td>/';

or

$regex = '#<td>(.+?) </td>#';

Leave a Comment