Need help flattening multiple images into 1 .png

Hi guys. I’m done the coding of my warning map. It is a base background map and if there is a warning for a given area…an overlay for that area shows…only if the condition is met though. I was wondering if there is a way to flatten the showing overlays into a .png…instead of having my cronjob create the php page…just create the png image instead. Here is the code
[php]<?php
ob_start();

$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-94_e.xml’;
$search_torwatch = ‘TORNADO WATCH IN EFFECT’;
$search_svrwatch = ‘SEVERE THUNDERSTORM WATCH IN EFFECT’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_torwatch) !== FALSE){
// There’s a watch.
echo ‘’;
} else if (strpos($file_contents, $search_svrwatch) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}

$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-147_e.xml’;
$search_torwatch = ‘TORNADO WATCH IN EFFECT’;
$search_svrwatch = ‘SEVERE THUNDERSTORM WATCH IN EFFECT’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_torwatch) !== FALSE){
// There’s a watch.
echo ‘’;
} else if (strpos($file_contents, $search_svrwatch) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}

$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-46_e.xml’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-137_e.xml’;
$search_torwatch = ‘TORNADO WATCH IN EFFECT’;
$search_svrwatch = ‘SEVERE THUNDERSTORM WATCH IN EFFECT’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_torwatch) !== FALSE){
// There’s a watch.
echo ‘’;
} else if (strpos($file_contents, $search_svrwatch) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-116_e.xml’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-98_e.xml’;
$search_torwatch = ‘TORNADO WATCH IN EFFECT’;
$search_svrwatch = ‘SEVERE THUNDERSTORM WATCH IN EFFECT’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_torwatch) !== FALSE){
// There’s a watch.
echo ‘’;
} else if (strpos($file_contents, $search_svrwatch) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-172_e.xml’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-15_e.xml’;
$search_torwatch = ‘TORNADO WATCH IN EFFECT’;
$search_svrwatch = ‘SEVERE THUNDERSTORM WATCH IN EFFECT’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_torwatch) !== FALSE){
// There’s a watch.
echo ‘’;
} else if (strpos($file_contents, $search_svrwatch) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-151_e.xml’;
$search_torwatch = ‘TORNADO WATCH IN EFFECT’;
$search_svrwatch = ‘SEVERE THUNDERSTORM WATCH IN EFFECT’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_torwatch) !== FALSE){
// There’s a watch.
echo ‘’;
} else if (strpos($file_contents, $search_svrwatch) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-169_e.xml’;
$search_torwarn = ‘SEVERE THUNDERSTORM WATCH IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-49_e.xml’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$url = ‘http://www.weatheroffice.gc.ca/rss/warning/on-13_e.xml’;
$search_torwarn = ‘TORNADO WARNING IN EFFECT’;
$search_svrwarn = ‘SEVERE THUNDERSTORM WARNING IN EFFECT’;
$file_contents = file_get_contents($url);

if(strpos($file_contents, $search_torwarn) !== FALSE){
// There’s a watch.
echo ‘’;

} else if(strpos($file_contents, $search_svrwarn) !== FALSE){
// There’s a watch.
echo ‘’;
}
else
{
echo ‘’;
}
$page = ob_get_contents();
ob_end_flush();
$fp = fopen(“ecwarnings.php”,“w”);
$fp1 = fopen(“ecwarnings.html”,“w”);
fwrite($fp,$page);
fclose($fp);
?>[/php]

You could use css to add overlays to png althoguth not all browsers will support this.
But this is another option for you to think about.

Sponsor our Newsletter | Privacy Policy | Terms of Service