Forum Moderators: coopster
<?php
$url="http://weather.yahoo.com/forecast/USCA0860.html"; //Yahoo Weather URL. Sub USCA0860 for your code.
$divStart = "<div class="forecast-icon";">$strEnd = "'); _background-image/* */: none;";
$start = strpos($file_contents, $divStart) + 50;
$end = strpos($file_contents, $strEnd);
$length = $end-$start;
$imagepath=substr($file_contents, $start , $length); //Pulls path to image
$image=imagecreatefrompng($imagepath); //Pulls image source into PHP
imagealphablending($image, true); //Enable alpha blending (important)
imagesavealpha($image, true); //Applies alpha to image.
header('Content-Type: image/png'); //Identifies itself as a PNG image
imagepng($image); //Outputs image contents
?>
I am getting the following error:
Parse error: parse error, unexpected T_STRING in /home/orange01/public_html/ml_scripts/94602weather.php on line 4
Anything look obviously wrong in the code? Thanks!