How to handle page scraping errors with Simple HTML Dom Parser
You need to predefine the variables before you use them. For $images
it would be
$images = array();
right after if (!empty($url)) {
etc
if (array_key_exists('images', $data)) { // display the image }else{ //set a default image, etc}
or something like isset
you can suppress errors by using the @ symbol. i.e.
@ $data['images'] = $images;