PHP City Guess Country Game Primer Tutorial

PHP City Guess Country Game Primer Tutorial

PHP City Guess Country Game Primer Tutorial

There is no end to the variety of web applications you can do by seeing what free information is out there, but please don’t disrepect the sources of that information. The source for our information today is the excellent XML files created at Webservices … so … thanks.

Today’s game is deceptively simple but quite dynamic, in the sense that we set aside a web server directory for our game today that we have called “City Guess Country Game” and whatever subset of XML files you have from //www.webservicex.net/new/Home/Index are dynamically read to be the source of information. Here, for the next level up of dynamism you’d involve an RSS feed perhaps, but, today, we just talk about using what we statically have “plonked” in our directory set aside for the game. The word “plonked” always makes me associate with the ever useful PHP method called glob … yes … glob … and so it is here, because that “globbing” definitely goes on. What you will perhaps be disappointed with today is that we don’t use PHP XML native functionality to process the XML data, and please know we recommend trying these approaches as you see fit, but we find the PHP explode method relatively easy to deploy for scenarios like this where the data form is so predictable, and simple.

Deceptively simple games can sometimes be the best, and find that that interest, or not, relates to what we are interested in ourselves … for me that, in particular, is atlases, geography, the “where” of life … so today’s game interests me as much as it will bore others (no doubt).

We show you PHP source code you could call city_guess.php and a live run link as well.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Games, Tutorials and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>