I have a dynamic image coded in PHP, which is supposed to serve as a display for statistics, using an external site. Each statistic will be displayed using the following general code:
imagettftext($template,10,0,5,35,$black,$font,$statVar1);
...where $statVar1 is the name of the first statistic that will be shown (I have a total of 99 to display).
The only way I know how to do this is to use PHP with JSON, to save the data to a file, and then load them, whenever the image is displayed, but I don't need that sort of data saving in this case, so all I am looking for is just to display whatever the content is on the source page at the same time that the image was loaded.
My JSON solution involved getElementsByTagName, and I would select out the HTML tags and select the right one with item(), but is there a pure PHP solution I could use instead? For instance, if I wanted to visit the DC Vault site, and set my $statVar1 to the Overall Position value of the first team (ie, display '1' on my stat image), what would I do?