If you’d like to add the hilarious comic strip What The Duck to your website, here is a quick and easy solution using PHP.
First, we need a function that will fetch the What The Duck RSS feed and parse it into an array from which we can extract what data we want. This function, below, is called getWhatTheDuck() .
Second, we need another function that will take that array of data and format it. We can display just the latest comic strip or any number up to the total featured in the RSS feed.
For the purposes of this sharing of knowledge, the code will loop through the array and output everything that’s available. It should be a simple matter to change the loop to go through only once if you only want to display the latest strip.