Hello,
I am having an issue while trying to embed HTML in PHP. I have setup a CRON job to download an XML file from NOAA every so often. I have a small PHP script that parses the XML, and another to format it for display on my webpage.
Here's the rub... I want to use images to display the data. I have created small gifs for the numbers 0 to 9, and want to display those in the place of text. Now, this seems to work with the exception of line 10, which does absolutely nothing as far as I can tell. It isn't displaying my images, or throwing up any errors. If I replace that line with print $y{$x}, it displays the digits in plain text.
I am pretty sure my problem is that I am absolutely lost when it comes to embedding HTML inside PHP tags. Total newbie to PHP here, constructive criticism is most welcome, as is a nudge in the proper direction. Any assistance would be most appreciated.
$y = "";
for ($x=0;
// $weatherArray[temp_f] is the current temperature. i.e. "87"
$x <= strlen($weatherArray[temp_f]);
$y{$x} = $weatherArray[temp_f]{$x},
$x++);
for ($x=0;
$x <= strlen($y);
echo "<img src='images/", $y{$x} +".gif", "' alt='", $y{$x},"' />",
$x++);