I have just updated the What The Duck PHP code for including the comic strip into any web page.
Here’s a sample for those not already familiar with this hilarious photography-oriented comic strip.
Online Business for your Small Business
I have just updated the What The Duck PHP code for including the comic strip into any web page.
Here’s a sample for those not already familiar with this hilarious photography-oriented comic strip.
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.
Copyright © 2012 · Genesis Theme Framework by StudioPress · WordPress · Log in