{"id":50731,"date":"2020-11-02T03:01:15","date_gmt":"2020-11-01T17:01:15","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=50731"},"modified":"2020-11-01T13:14:41","modified_gmt":"2020-11-01T03:14:41","slug":"php-city-guess-country-game-keyboard-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-keyboard-tutorial\/","title":{"rendered":"PHP City Guess Country Game Keyboard Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP City Guess Country Game Keyboard Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/more_keyboard.jpg\" title=\"PHP City Guess Country Game Keyboard Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">PHP City Guess Country Game Keyboard Tutorial<\/p><\/div>\n<p>Regarding yesterday&#8217;s <a title='PHP City Guess Country Game Zip Tutorial' href='#phpcgcgzt'>PHP City Guess Country Game Zip Tutorial<\/a>&#8216;s web application, like many others, most people would say there is available to them, input wise, and once they have started it up from the web browser address bar &#8230;<\/p>\n<ul>\n<li>mouse or touch input &#8230; and &#8230;<\/li>\n<li>keyboard input<\/li>\n<\/ul>\n<p> &#8230; modes of use, though with this particular web application, most people will just use their mouse or touchpad, we guess.  But bringing back a concept from the earlier &#8220;GUI desktop days&#8221; before the &#8220;online web days&#8221; it was an accessibility &#8220;badge of honour&#8221; to design programs that could be worked with both input modes above, or <i>either<\/i>.  And getting our web application work for <i>just keyboard<\/i> is easy enough by attaching &#8230;<\/p>\n<ul>\n<li>&#8220;onkeypress&#8221; event logic (return<font size=1>ing<\/font> <i>false<\/i>) to trap letters and space characters &#8230; &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n var completefinding='';<br \/>\n<br \/>\n function okp(event) {<br \/>\n    var optl=[], joptl=0, jdone=false, findings='', findingsd='', lendiff='', lendiffd='';<br \/>\n    completefinding='';<br \/>\n    if (event.keyCode &gt;= 65 && event.keyCode &lt;= 90) {<br \/>\n      kbsofar+=String.fromCharCode(event.keyCode);<br \/>\n      \/\/document.title=kbsofar;<br \/>\n      if (kbsofar.length == 2 && kbsofar == kbsofar.toUpperCase()) {<br \/>\n        optl=document.getElementsByTagName('option');<br \/>\n        for (joptl=1; joptl&lt;optl.length; joptl++) {<br \/>\n          if (('' + optl[joptl].getAttribute('data-iso')) == kbsofar && !jdone) {<br \/>\n            \/\/alert(optl[joptl].outerHTML);<br \/>\n            jdone=true;<br \/>\n            document.getElementById('ucountry').value=optl[joptl].value;<br \/>\n            notc=' (not ' + optl[joptl].innerHTML + ')';<br \/>\n            picked(document.getElementById('ucountry').value, document.getElementById('ucountry'));<br \/>\n            kbsofar='';<br \/>\n          }<br \/>\n        }<br \/>\n      } else {<br \/>\n        optl=document.getElementsByTagName('option');<br \/>\n        for (joptl=1; joptl&lt;optl.length; joptl++) {<br \/>\n          if (optl[joptl].value != '' && ('' + optl[joptl].innerHTML.toLowerCase()).indexOf(kbsofar.toLowerCase()) == 0 && ('' + optl[joptl].outerHTML).indexOf(' data-') != -1) {<br \/>\n            lendiff+=lendiffd + eval(eval('' + optl[joptl].value.length) - eval('' + kbsofar.length));<br \/>\n            lendiffd=',';<br \/>\n            if (eval(eval('' + optl[joptl].value.length) - eval('' + kbsofar.length)) &lt;= 4) {<br \/>\n              if (completefinding == '') {<br \/>\n                completefinding=optl[joptl].value;<br \/>\n              } else {<br \/>\n                completefinding=' ';<br \/>\n              }<br \/>\n            }<br \/>\n            findings+=findingsd + optl[joptl].value;<br \/>\n            findingsd=',';<br \/>\n          }<br \/>\n        }<br \/>\n        if (findings == '') {<br \/>\n        document.getElementById('oneopt').innerHTML='Please select Country ...';<br \/>\n        kbsofar='';<br \/>\n        } else if (findings.indexOf(',') != -1) {<br \/>\n        document.getElementById('oneopt').innerHTML=findings;<br \/>\n        document.getElementById('ucountry').title=document.getElementById('ucountry').title.split(' ... ')[0] + ' ... ' + findings;<br \/>\n        \/\/document.title=lendiff + ' .... ' + completefinding;<br \/>\n        if (completefinding.trim() != '') {<br \/>\n          setTimeout(dodecide,2000);<br \/>\n        }<br \/>\n        } else {<br \/>\n            document.getElementById('ucountry').value=findings;<br \/>\n            notc=' (not ' + findings + ')';<br \/>\n            picked(document.getElementById('ucountry').value, document.getElementById('ucountry'));<br \/>\n            kbsofar='';<br \/>\n            \/\/ location.href='#cgcform';<br \/>\n        }<br \/>\n      }<br \/>\n    } else if ((event.keyCode &gt;= 97 && event.keyCode &lt;= 122) || event.keyCode == 32) {<br \/>\n      kbsofar+=String.fromCharCode(event.keyCode);<br \/>\n        optl=document.getElementsByTagName('option');<br \/>\n        for (joptl=1; joptl&lt;optl.length; joptl++) {<br \/>\n          if (optl[joptl].value != '' && ('' + optl[joptl].innerHTML.toLowerCase()).indexOf(kbsofar.toLowerCase()) == 0 && ('' + optl[joptl].outerHTML).indexOf(' data-') != -1) {<br \/>\n            lendiff+=lendiffd + eval(eval('' + optl[joptl].value.length) - eval('' + kbsofar.length));<br \/>\n            lendiffd=',';<br \/>\n            if (eval(eval('' + optl[joptl].value.length) - eval('' + kbsofar.length)) &lt;= 4) {<br \/>\n              if (completefinding == '') {<br \/>\n                completefinding=optl[joptl].value;<br \/>\n              } else {<br \/>\n                completefinding=' ';<br \/>\n              }<br \/>\n            }<br \/>\n            findings+=findingsd + optl[joptl].value;<br \/>\n            findingsd=',';<br \/>\n          }<br \/>\n        }<br \/>\n        if (findings == '') {<br \/>\n        document.getElementById('oneopt').innerHTML='Please select Country ...';<br \/>\n        kbsofar='';<br \/>\n        } else if (findings.indexOf(',') != -1) {<br \/>\n        document.getElementById('oneopt').innerHTML=findings;<br \/>\n        document.getElementById('ucountry').title=document.getElementById('ucountry').title.split(' ... ')[0] + ' ... ' + findings;<br \/>\n        \/\/document.title=lendiff + ' ... ' + completefinding;<br \/>\n        if (completefinding.trim() != '') {<br \/>\n          setTimeout(dodecide,2000);<br \/>\n        }<br \/>\n        } else {<br \/>\n            document.getElementById('ucountry').value=findings;<br \/>\n            notc=' (not ' + findings + ')';<br \/>\n            picked(document.getElementById('ucountry').value, document.getElementById('ucountry'));<br \/>\n            kbsofar='';<br \/>\n            \/\/ location.href='#cgcform';<br \/>\n        }<br \/>\n    }<br \/>\n    return <i>false<\/i>;<br \/>\n}<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; that <i>false<\/i> return <font color=green>meaning that your key presses have no effect<\/font> &#8230; and &#8230;<\/li>\n<li>&#8220;onkeydown&#8221; event logic to trap carriage returns &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n function crokp(event) {<br \/>\n     <font color=purple>if (event.keyCode == 13) {<br \/>\n        if (completefinding.trim() != '') {<br \/>\n            document.getElementById('ucountry').value=completefinding;<br \/>\n            notc=' (not ' + completefinding + ')';<br \/>\n            picked(document.getElementById('ucountry').value, document.getElementById('ucountry'));<br \/>\n            kbsofar='';<br \/>\n            completefinding='';<br \/>\n            \/\/ location.href='#cgcform';<br \/>\n        }<\/font> else <font color=olive>if (document.getElementById('bemail')) {<br \/>\n        document.getElementById('bemail').click();<br \/>\n        }<\/font><br \/>\n     }<br \/>\n }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; as a &#8220;bi-functionality&#8221; to be either a &#8230;<\/p>\n<ol>\n<li>user usage meaning that after entering &#8220;United States&#8221; (for instance) <font color=purple>the carriage return<\/font> settles for that rather than, say, &#8220;United States of America&#8221; &#8230; versus &#8230;<\/li>\n<li>a way to <font color=olive>programmatically click\/touch the &#8220;Email&#8221; button<\/font> <font size=1>(remembering our desire to be able to &#8220;just use keyboard&#8221; input)<\/font><\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p> &#8230; applied to the <font color=blue>document.body<\/font> element as per &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;body <font color=blue>onkeydown='crokp(event);' onkeypress='return okp(event);' <\/font>style='background-color: olive;' onload='setTimeout(getnext,1000);'&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; but what about mobile platforms such as iOS iPhone or iPad?  Well, luckily there is one HTML input type=text element in our web application (whose inherit<font size=1>ance<\/font> relationship to document.body ensures it reaches the Javascript logic above)<\/font> for a mobile user to focus on to bring up the keyboard functionality <font size=1>(okay, we admit defeat with this &#8220;touch&#8221; action functionality needed, as iOS does not allow the HTML element <i>focus()<\/i> (programmatical) method)<\/font>.<\/p>\n<p>Also, it will not be that many web application where &#8230;<\/p>\n<blockquote><p>\n<font color=green>meaning that your key presses have no effect<\/font>\n<\/p><\/blockquote>\n<p> &#8230; is going to be a viable strategy.  Happily, with our City Country Quiz, it is a viable strategy with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php-----GETME\" title=\"city_guess.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php-----GETME\" title=\"city_guess.php\">city_guess.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" title=\"Click picture\">City Guess Country game<\/a> in action, and how that extra keyboard functionality works.  For example, did you notice in the Javascript code way above how if &#8230;<\/p>\n<ol>\n<li>user enters two uppercase keyboard characters we look up all the ISO 2 character codes and accept any matches (as the user answer) &#8230; versus &#8230;<\/li>\n<li>any other characters go towards a left to right autocompletion feeling comma separated Country List being presented to the user until the specificity of the user characters weedles that list down to one (as the user user answer)<\/li>\n<\/ol>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-keyboard-tutorial\/'>New PHP City Guess Country Game Keyboard Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpcgcgzt'>Previous relevant <a target=_blank title='PHP City Guess Country Game Zip Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-zip-tutorial\/'>PHP City Guess Country Game Zip Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP City Guess Country Game Zip Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/more_zip_choices.jpg\" title=\"PHP City Guess Country Game Zip Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">PHP City Guess Country Game Zip Tutorial<\/p><\/div>\n<p>On top of the recent <a title='PHP City Guess Country Game Flag Emoji Tutorial' href='#phpcgcgfet'>PHP City Guess Country Game Flag Emoji Tutorial<\/a>&#8216;s progress today we allow for &#8230;<\/p>\n<ul>\n<li>zipped up XML data in the same format as &#8230;<\/li>\n<li>XML data files (as always) &#8230; and &#8230;<\/li>\n<li>zipped up CSV data thanks to the great <a target=_blank title='World Cities Database' href='https:\/\/simplemaps.com\/data\/world-cities'>World Cities Database<\/a> &#8230; who we would like to thank profusely<\/li>\n<\/ul>\n<p>Does this mean we can now reduce the inodes used by the web server and delete the original XML files?   Yes, because PHP has the wherewithal to read the data within the zip file and not need it to land on the web server disk, but <i>&#8220;no&#8221;, because<\/i> we want to look into the (new version lack of) speed and so have kept, for now (at least), a division of web application usage &#8230;<\/p>\n<table style='width:100%;' border=20>\n<tr>\n<th>Faster <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/\" title=\"Click picture\">original version<\/a> with less data available to choose from &#8230;<\/th>\n<\/tr>\n<tr>\n<td><iframe src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/\" style=\"width:100%;height:600px;\"><\/iframe><\/td>\n<\/tr>\n<tr>\n<th>Slower <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" title=\"Click picture\">new version<\/a> with more (zip derived) data available to choose from &#8230;<\/th>\n<\/tr>\n<tr>\n<td><iframe src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" style=\"width:100%;height:600px;\"><\/iframe><\/td>\n<\/tr>\n<\/table>\n<p> &#8230; via <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php----GETME\" title=\"city_guess.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php----GETME\" title=\"city_guess.php\">city_guess.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" title=\"Click picture\">City Guess Country game<\/a> in action, that extra zip file functionality PHP looking like &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\nforeach (glob(\"*.zip\") as $zipfile) {<br \/>\n     $zip = zip_open($zipfile);<br \/>\n     if ($zip) {<br \/>\n      $outxml=\" \";<br \/>\n      while ($zip_entry = zip_read($zip)) {<br \/>\n       $ourfilename=zip_entry_name($zip_entry);<br \/>\n       $regexpok=0;<br \/>\n       if (strpos($ourfilename, \"_MACOSX\/\") === false) {<br \/>\n        \/\/$regexp=\"\/^[\\S]\" . str_replace('[\\s\\S]?','[\\s\\S]*',str_replace('*','[\\s\\S]?',str_replace('?',',',str_replace('%',',',str_replace('.','[.]',$ofwhat))))) . \"$\/\";<br \/>\n        \/\/$regexpok=preg_match($regexp, explode(\"\/\",$ourfilename)[-1 + sizeof(explode(\"\/\",$ourfilename))]);<br \/>\n        $regexpok=1;<br \/>\n        if ($regexpok !== 0) {<br \/>\n         if ($outxml == \" \") { $outxml=\"\"; }<br \/>\n         $fchunk=zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));<br \/>\n<br \/> <br \/>\n         if (strpos(strtolower($ourfilename), \".xml\") !== false && strpos($fchunk, \"&lt;City&gt;\") !== false && strpos($fchunk, \"&lt;Country&gt;\") !== false) {<br \/>\n       \/\/echo strtoupper($ourfilename) . \"\\n\";<br \/>\n $bits=explode(\"&lt;City&gt;\", $fchunk);<br \/>\n for ($i=1; $i&lt;sizeof($bits); $i++) {<br \/>\n  $thistwobits=explode(\"&lt;\", $bits[$i]);<br \/>\n  $citiesarr[sizeof($citiesarr)]=$thistwobits[0];<br \/>\n  $thistwobits=explode(\"&lt;Country&gt;\", $bits[-1 + $i]);<br \/>\n  $thosetwobits=explode(\"&lt;\", $thistwobits[-1 + sizeof($thistwobits)]);<br \/>\n  $countriesarr[sizeof($countriesarr)]=$thosetwobits[0];<br \/>\n  if (strpos($ctyisotwo, \"&gt;\" . $thosetwobits[0]) !== false) {<br \/>\n    $countriesisotwo[sizeof($countriesisotwo)]=getih(trim(explode(\"&lt;\",explode('\"&gt;', explode(\"&gt;\" . $thosetwobits[0],$ctyisotwo)[1])[1])[0]));<br \/>\n  } else {<br \/>\n    $countriesisotwo[sizeof($countriesisotwo)]=trim(\"  \");<br \/>\n  }<br \/>\n  if (!strstr($uniquecountries, \",\" . urlencode($thosetwobits[0] . $countriesisotwo[-1 + sizeof($countriesisotwo)]) . \",\")) {<br \/>\n   $uniquecountries .= urlencode($thosetwobits[0] . $countriesisotwo[-1 + sizeof($countriesisotwo)]) . \",\";<br \/>\n   \/\/echo $thosetwobits[0] . \"\\n\";<br \/>\n  }<br \/>\n<br \/> <br \/>\n  $countriesarr[-1 + sizeof($countriesarr)].=$countriesisotwo[-1 + sizeof($countriesisotwo)];<br \/>\n  $countriesisotwo[-1 + sizeof($countriesisotwo)]='';<br \/>\n<br \/>\n \/\/echo \"0:\" . sizeof($countriesarr) . \"\\n\";<br \/>\n }<br \/>\n         } else if (strpos(strtolower($ourfilename), \".csv\") !== false) { \/\/ thanks to https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-admin\/post.php?post=50720&action=edit&message=1<br \/>\n\/\/ \"city\",\"city_ascii\",\"lat\",\"lng\",\"country\",\"iso2\",\"iso3\",\"admin_name\",\"capital\",\"population\",\"id\"<br \/>\n\/\/ \"Tokyo\",\"Tokyo\",\"35.6897\",\"139.6922\",\"Japan\",\"JP\",\"JPN\",\"T\u014dky\u014d\",\"primary\",\"37977000\",\"1392685764\"<br \/>\n\/\/ \"Jakarta\",\"Jakarta\",\"-6.2146\",\"106.8451\",\"Indonesia\",\"ID\",\"IDN\",\"Jakarta\",\"primary\",\"34540000\",\"1360771077\"<br \/>\n<br \/>\n       \/\/echo strtolower($ourfilename) . \"\\n\";<br \/>\n $bits=explode(\"\\n\", $fchunk);<br \/>\n $hbit=str_replace('\"','',strtolower($bits[0]));<br \/>\n $hbits=explode(\",\", $hbit);<br \/>\n $citycol=-1;<br \/>\n $countrycol=-1;<br \/>\n $isocol=-1;<br \/>\n if (strpos((\",\" . $hbit . \",\"), \",city\") !== false && strpos((\",\" . $hbit . \",\"), \",country\") !== false && strpos($hbit, \",\") !== false) {<br \/>\n for ($i=0; $i&lt;sizeof($hbits); $i++) {<br \/>\n   if ($citycol == -1 && strpos($hbits[$i], \"city\") !== false) {<br \/>\n     $citycol=$i;<br \/>\n   } else if ($countrycol == -1 && strpos($hbits[$i], \"country\") !== false) {<br \/>\n     $countrycol=$i;<br \/>\n   } else if ($isocol == -1 && strpos($hbits[$i], \"iso\") !== false) {<br \/>\n     $isocol=$i;<br \/>\n   }<br \/>\n }<br \/>\n if ($citycol &gt;=0 && $countrycol &gt;= 0) {<br \/>\n for ($i=1; $i&lt;sizeof($bits); $i++) {<br \/>\n  if (substr(str_replace('\"','',explode(\",\",$bits[$i])[$countrycol]),0,1) &gt;= \"A\") {<br \/>\n  if (substr($bits[$i],0,1) == '\"') {<br \/>\n  $citiesarr[sizeof($citiesarr)]=str_replace('\"','',explode('\",\"',$bits[$i])[$citycol]);<br \/>\n  } else {<br \/>\n  $citiesarr[sizeof($citiesarr)]=explode(\",\",$bits[$i])[$citycol];<br \/>\n  }<br \/>\n  if (substr($bits[$i],0,1) == '\"') {<br \/>\n  $countriesarr[sizeof($countriesarr)]=str_replace('\"','',explode(\",\",$bits[$i])[$countrycol]);<br \/>\n  } else {<br \/>\n  $countriesarr[sizeof($countriesarr)]=explode(\",\",$bits[$i])[$countrycol];<br \/>\n  }<br \/>\n  if ($isocol &gt;= 0) {<br \/>\n    if (substr($bits[$i],0,1) == '\"') {<br \/>\n    $countriesisotwo[sizeof($countriesisotwo)]=getih(str_replace('\"','',explode(\",\",$bits[$i])[$isocol]));<br \/>\n    } else {<br \/>\n    $countriesisotwo[sizeof($countriesisotwo)]=getih(explode(\",\",$bits[$i])[$isocol]);<br \/>\n    }<br \/>\n  } else {<br \/>\n    $countriesisotwo[sizeof($countriesisotwo)]=trim(\"  \");<br \/>\n  }<br \/>\n  if (!strstr($uniquecountries, \",\" . urlencode(str_replace('\"','',explode(\",\",$bits[$i])[$countrycol]) . $countriesisotwo[-1 + sizeof($countriesisotwo)]) . \",\")) {<br \/>\n   $uniquecountries .= urlencode(str_replace('\"','',explode(\",\",$bits[$i])[$countrycol]) . $countriesisotwo[-1 + sizeof($countriesisotwo)]) . \",\";<br \/>\n \/\/echo str_replace('\"','',explode(\",\",$bits[$i])[$countrycol]) . \"\\n\";<br \/>\n  }<br \/>\n<br \/> <br \/>\n  $countriesarr[-1 + sizeof($countriesarr)].=$countriesisotwo[-1 + sizeof($countriesisotwo)];<br \/>\n  $countriesisotwo[-1 + sizeof($countriesisotwo)]='';<br \/>\n  }<br \/>\n }<br \/>\n }<br \/>\n }<br \/>\n<br \/>\n         }<br \/>\n        }<br \/>\n       }<br \/>\n      }<br \/>\n      zip_close($zip);<br \/>\n      $zip=null;<br \/>\n     }<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-zip-tutorial\/'>PHP City Guess Country Game Zip Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpcgcgfet'>Previous relevant <a target=_blank title='PHP City Guess Country Game Flag Emoji Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-flag-emoji-tutorial\/'>PHP City Guess Country Game Flag Emoji Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP City Guess Country Game Flag Emoji Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess_readability_flag_emoji.jpg\" title=\"PHP City Guess Country Game Flag Emoji Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">PHP City Guess Country Game Flag Emoji Tutorial<\/p><\/div>\n<p>On top of yesterday&#8217;s <a title='PHP City Guess Country Game Data Extension Tutorial' href='#phpcgcgdet'>PHP City Guess Country Game Data Extension Tutorial<\/a> today&#8217;s progress zeroes in on some aesthetic ideas &#8230;<\/p>\n<ul>\n<li>add country flag emojis <font color=blue>(for interest sake)<\/font> &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n<font color=blue>function getih($indefe) {<br \/>\n$lri=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ^$\";<br \/>\n$zri=\"abcdefghijklmnopqrstuvwxyz^$0123456789#@!~`\";<br \/>\n$dri=[\"127462\",\"127463\",\"127464\",\"127465\",\"127466\",\"127467\",\"127468\",\"127469\",\"127470\",\"127471\",\"127472\",\"127473\",\"127474\",\"127475\",\"127476\",\"127477\",\"127478\",\"127479\",\"127480\",\"127481\",\"127482\",\"127483\",\"127484\",\"127485\",\"127486\",\"127487\",\"127988\",\"917631\"];<br \/>\n$sri=[\"917601\",\"917602\",\"917603\",\"917604\",\"917605\",\"917606\",\"917607\",\"917608\",\"917609\",\"917610\",\"917611\",\"917612\",\"917613\",\"917614\",\"917615\",\"917616\",\"917617\",\"917618\",\"917619\",\"917620\",\"917621\",\"917622\",\"917623\",\"917624\",\"917625\",\"917626\",\"127988\",\"917631\",\"30\",\"31\",\"32\",\"33\",\"34\",\"35\",\"36\",\"37\",\"38\",\"39\",\"127937\",\"65039\",\"8205\",\"127752\",\"127987\"];<br \/>\n      $thiscc=$indefe;<br \/>\n      $ccsuff='';<br \/>\n      $ccchar=' ';<br \/>\n      $cde='&#';<br \/>\n      for ($iccsuff=0; $iccsuff&lt;strlen($thiscc); $iccsuff++) {<br \/>\n        $ccchar=substr($thiscc, $iccsuff, (1 + $iccsuff));<br \/>\n        if (strtolower($ccchar) == $ccchar) {<br \/>\n        $ccsuff.=$cde . $sri[strpos($lri,$ccchar)] . ';'; \/\/'&#' + dri[eval('' + lri.indexOf(ccchar))] + ';';<br \/>\n        } else {<br \/>\n        $ccsuff.=$cde . $dri[strpos($lri,$ccchar)] . ';'; \/\/'&#' + dri[eval('' + lri.indexOf(ccchar))] + ';';<br \/>\n        }<br \/>\n      }<br \/>\n      return $ccsuff;<br \/>\n}<\/font><br \/>\n<br \/>\nforeach (glob(\"*cities*.xml\") as $filename) {<br \/>\n $fchunk=file_get_contents($filename);<br \/>\n $bits=explode(\"&lt;City&gt;\", $fchunk);<br \/>\n for ($i=1; $i&lt;sizeof($bits); $i++) {<br \/>\n  $thistwobits=explode(\"&lt;\", $bits[$i]);<br \/>\n  $citiesarr[sizeof($citiesarr)]=$thistwobits[0];<br \/>\n  $thistwobits=explode(\"&lt;Country&gt;\", $bits[-1 + $i]);<br \/>\n  $thosetwobits=explode(\"&lt;\", $thistwobits[-1 + sizeof($thistwobits)]);<br \/>\n  $countriesarr[sizeof($countriesarr)]=$thosetwobits[0];<br \/>\n  <font color=blue>if (strpos($ctyisotwo, \"&gt;\" . $thosetwobits[0]) !== false) {<br \/>\n    $countriesisotwo[sizeof($countriesisotwo)]=<font color=blue>getih(<\/font>trim(explode(\"&lt;\",explode('\"&gt;', explode(\"&gt;\" . $thosetwobits[0],$ctyisotwo)[1])[1])[0])<font color=blue>)<\/font>;<br \/>\n  } else {<br \/>\n    $countriesisotwo[sizeof($countriesisotwo)]=trim(\"  \");<br \/>\n  }<\/font><br \/>\n  if (!strstr($uniquecountries, \",\" . urlencode($thosetwobits[0]<font color=blue> . $countriesisotwo[-1 + sizeof($countriesisotwo)]<\/font>) . \",\")) {<br \/>\n   $uniquecountries .= urlencode($thosetwobits[0]<font color=blue> . $countriesisotwo[-1 + sizeof($countriesisotwo)]<\/font>) . \",\";<br \/>\n  }<br \/>\n<br \/>\n  <font color=blue>$countriesarr[-1 + sizeof($countriesarr)].=$countriesisotwo[-1 + sizeof($countriesisotwo)];<br \/>\n  $countriesisotwo[-1 + sizeof($countriesisotwo)]='';<\/font><br \/>\n<br \/>\n }<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; using another <i>&#8220;data extension&#8221;<\/i> via the incredibly <a target=_blank title='Useful link' href='http:\/\/www.nationsonline.org\/oneworld\/country_code_list.htm'>useful link<\/a> where a Country name can be linked to an ISO 2 character country code (integral to forming those country flag emojis in the PHP code above)\n<\/li>\n<li>increase readability by increasing font and element sizes<\/li>\n<\/ul>\n<p>See <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php---GETME\" title=\"city_guess.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php---GETME\" title=\"city_guess.php\">city_guess.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" title=\"Click picture\">City Guess Country game<\/a> in action.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-flag-emoji-tutorial\/'>PHP City Guess Country Game Flag Emoji Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpcgcgdet'>Previous relevant <a target=_blank title='PHP City Guess Country Game Data Extension Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-data-extension-tutorial\/'>PHP City Guess Country Game Data Extension Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP City Guess Country Game Data Extension Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess_data_extension.jpg\" title=\"PHP City Guess Country Game Data Extension Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">PHP City Guess Country Game Data Extension Tutorial<\/p><\/div>\n<p>We had occasion to revisit the &#8220;City Guess Country Game&#8221; web application of <a title='PHP City Guess Country Game Sharing Tutorial' href='#phpcgcgst'>PHP City Guess Country Game Sharing Tutorial<\/a> and were dismayed at the absence of &#8220;Belgium&#8221; on the country list.   We looked into the workings of the web application and found that it based its City and Country dropdowns based on the contents of <a target=_blank title='http:\/\/www.webserviceX.NET' href='http:\/\/www.webserviceX.NET'>Webservices<\/a> XML files <font size=1>(who we would like to thank profusely)<\/font>.<\/p>\n<p>How to start seeing Belgium, <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=n2lEC58jtMI'>even though we write this on a Wednesday<\/a>?  We think we could either &#8230;<\/p>\n<ul>\n<li>start accessing the <a target=_blank title='http:\/\/www.webserviceX.NET' href='http:\/\/www.webserviceX.NET'>Webservices<\/a> Belgium XML file <font size=1>(but, sadly, if you&#8217;ve tried that last link, you can see why not)<\/font> &#8230; or &#8230;<\/li>\n<li>&#8220;data extend&#8221; <font size=1>(not talk about file extensions)<\/font> the Capitals and Countries data sets of <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/country-via-capital-placeholder-quiz-game-tutorial\/' title='Country via Capital Placeholder Quiz Game Tutorial'>Country via Capital Placeholder Quiz Game Tutorial<\/a> and that way, guarantee at least one city entry per country<\/li>\n<\/ul>\n<p> &#8230; and yes, we opted for the latter.  And yes, we recognize there will be a lopsided number of cities linking to the XML data countries.  True enough, but playing the quiz, this does not detract from the interest of the quiz in our opinion.  And it feels that much more interesting and challenging seeing a full list of country (answer) options for any city (question) ask, in our opinion.<\/p>\n<p>But the proof is in the &#8220;user pudding&#8221; and perhaps you will find <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php--GETME\" title=\"city_guess.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php--GETME\" title=\"city_guess.php\">city_guess.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" title=\"Click picture\">City Guess Country game<\/a> more or less challenging than the one lacking Belgium <font size=1>(perhaps because it&#8217;s Wednesday?)<\/font><\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" style=\"width:100%;height:600px;\"><\/iframe><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-data-extension-tutorial\/'>PHP City Guess Country Game Data Extension Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpcgcgst'>Previous relevant <a target=_blank title='PHP City Guess Country Game Sharing Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-sharing-tutorial\/'>PHP City Guess Country Game Sharing Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP City Guess Country Game Sharing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess_email.jpg\" title=\"PHP City Guess Country Game Sharing Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">PHP City Guess Country Game Sharing Tutorial<\/p><\/div>\n<p>We mentioned how much thought was needed for our revamped Nimh game to involve an Inline HTML Form Email, and thereby be spurning any Javascript &#8220;smarts&#8221; already involved, so as to both &#8230;<\/p>\n<ul>\n<li>collaborate and share and involve more than one game player &#8230; as well as &#8230;<\/li>\n<li>seeing the graphics of that game there in the body section of the email<\/li>\n<\/ul>\n<p> &#8230; and so, rather than jumping straight into Nimh (ouch! &#8230; got burnt!) we are picking &#8230;<\/p>\n<ul>\n<li>a simple PHP game &#8230;<\/li>\n<li>currently involving lots of Javascript &#8220;smarts&#8221; in its workings &#8230;<\/p>\n<li>not yet involving any Inline HTML Form Email functionality<\/li>\n<\/ul>\n<p> &#8230; and work towards collaborating and sharing via those means.  The verdict?  Yes, even for &#8220;small games&#8221; like <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php-GETME\" title=\"city_guess.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php-GETME\" title=\"city_guess.php\">city_guess.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" title=\"Click picture\">City Guess Country game<\/a> (you can read the background to, with <a title='PHP City Guess Country Game Primer Tutorial' href='#phpcgcgpt'>PHP City Guess Country Game Primer Tutorial<\/a>), it is no doddle to think &#8220;no Javascript&#8221;.  It is an exercise that helps you appreciate the power and usefulness of client-side Javascript in web applications.  The upside is an improvement of your appreciation of how to pare something down to those smaller &#8220;navigatable&#8221; HTML form snippets to break a concept into collaborative and sharable parts.<\/p>\n<p>Two new HTML form elements become involved, to make this happen &#8230;<\/p>\n<ol>\n<li>the HTML form method=POST <font size=1>action=&#8217;\/\/www.rjmprogramming.com.au\/HTMLCSS\/emailhtml.php&#8217;<\/font> &#8230; to navigate to Inline HTML Form Email creating PHP helper web application &#8230;<br \/>\n<code><br \/>\n&lt;form target=iemail style=display:none; action='\/\/www.rjmprogramming.com.au\/HTMLCSS\/emailhtml.php' method=POST&gt;<br \/>\n &lt;input type=hidden name=inline value=''&gt;&lt;\/input&gt;<br \/>\n &lt;input type=hidden name=emailto id=emailto value=''&gt;&lt;\/input&gt;<br \/>\n &lt;input type=hidden name=subject id=subject value='City Guess Country Game'&gt;&lt;\/input&gt;<br \/>\n &lt;textarea style=display:none; name=htmlis id=htmlis value=''&gt;&lt;\/textarea&gt;<br \/>\n &lt;input type=submit style=display:none; id=contact value=Email&gt;&lt;\/input&gt;<br \/>\n &lt;\/form&gt;<br \/>\n<\/code><br \/>\n &#8230; filling in <i>emailto<\/i> (Email To) and <i>htmlis<\/i> (Inline HTML Form Email content) in a named HTML iframe element, so as not to have to navigate away from the web page &#8230;<br \/>\n<code><br \/>\n&lt;iframe name=iemail src=\/\/www.rjmprogramming.com.au\/HTMLCSS\/emailhtml.php style=display:none;&gt;&lt;\/iframe&gt;<br \/>\n<\/code>\n<\/li>\n<li>the HTML form method=GET <font size=1>action=&#8217;https:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php&#8217;<\/font> shell &#8230;<br \/>\n<code><br \/>\n&lt;form target=_top id=cgcform action='https:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php' method=GET&gt;<br \/>\n&lt;\/form&gt;<br \/>\n<\/code><br \/>\n &#8230; encasing existant HTML City and Country elements\n<\/li>\n<\/ol>\n<p> &#8230; and on returning to &#8220;web browser land&#8221; from &#8220;email client land&#8221; the emailee&#8217;s answers contribute to the PHP logic &#8230;<\/p>\n<p><code><br \/>\n$egoes=\"0\";<br \/>\n$escore=\"0\";<br \/>\n$emdef=\"\";<br \/>\n<br \/>\nif (isset($_GET['thiscity']) && isset($_GET['ucountry']) && isset($_GET['eanswer'])) {<br \/>\n  if ($_GET['ucountry'] == $_GET['eanswer']) {<br \/>\n    $egoes=\"1  Well done!  \" . str_replace(\"+\",\" \",urldecode($_GET['thiscity'])) . \" is indeed in \" . str_replace(\"+\",\" \",urldecode($_GET['eanswer'])) . \".\";<br \/>\n    $escore=\"1\";<br \/>\n  } else {<br \/>\n    $egoes=\"1  Sorry, &lt;a title='Google image search' style=cursor:pointer;text-decoration:underline; onclick=woit(this.innerHTML);&gt;\" . str_replace(\"+\",\" \",urldecode($_GET['thiscity'])) . \"&lt;\/a&gt; is in \" . str_replace(\"+\",\" \",urldecode($_GET['eanswer'])) . \" but is not in \" . str_replace(\"+\",\" \",urldecode($_GET['ucountry'])) . \".\";<br \/>\n  }<br \/>\n  if (isset($_GET['emailfrom'])) {<br \/>\n    $emdef=str_replace(\"+\",\" \",urldecode($_GET['emailfrom']));<br \/>\n  }<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; informing of the user of the &#8220;Check&#8221; (submit button) of their email dropdown selected Country answer for the City presented to them.<\/p>\n<p>We found that second method=GET was the means by which macOS Mail app and Webmail means of emailing were both supported.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-sharing-tutorial\/'>PHP City Guess Country Game Sharing Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpcgcgpt'>Previous relevant <a target=_blank title='PHP City Guess Country Game Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-primer-tutorial\/'>PHP City Guess Country Game Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP City Guess Country Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.jpg\" title=\"PHP City Guess Country Game Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">PHP City Guess Country Game Primer Tutorial<\/p><\/div>\n<p>There is no end to the variety of web applications you can do by seeing what free information is out there, but please don&#8217;t disrepect the sources of that information.  The source for our information today is the excellent XML files created at <a target=_blank title='http:\/\/www.webserviceX.NET' href='http:\/\/www.webserviceX.NET'>Webservices<\/a> &#8230; so &#8230; thanks.<\/p>\n<p>Today&#8217;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 &#8220;City Guess Country Game&#8221; and whatever subset of XML files you have from <a target=_blank title='http:\/\/www.webserviceX.NET' href='http:\/\/www.webserviceX.NET'>http:\/\/www.webservicex.net\/new\/Home\/Index<\/a> are dynamically read to be the source of information.  Here, for the next level up of dynamism you&#8217;d involve an RSS feed perhaps, but, today, we just talk about using what we statically have &#8220;plonked&#8221; in our directory set aside for the game.  The word &#8220;plonked&#8221; always makes me associate with the ever useful PHP method called <a target=_blank title='PHP glob method information' href='http:\/\/php.net\/manual\/en\/function.glob.php'><i>glob<\/i><\/a> &#8230; yes &#8230; glob &#8230; and so it is here, because that &#8220;globbing&#8221; definitely goes on.  What you will perhaps be disappointed with today is that we don&#8217;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 <a target=_blank href='http:\/\/php.net\/manual\/en\/function.explode.php' title='PHP explode method information'><i>explode<\/i><\/a> method relatively easy to deploy for scenarios like this where the data form is so predictable, and simple.<\/p>\n<p>Deceptively simple games can sometimes be the best, and find that that interest, or not, relates to what we are interested in ourselves &#8230; for me that, in particular, is atlases, geography, the &#8220;where&#8221; of life &#8230; so today&#8217;s game interests me as much as it will bore others (no doubt).<\/p>\n<p>We show you PHP source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php_GETME\" title=\"city_guess.php\">city_guess.php<\/a> and a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/CityGuessCountry\/city_guess.php\" title='Click picture'>live run<\/a> link as well.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d19522' onclick='var dv=document.getElementById(\"d19522\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/games\/\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d19522' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d48050' onclick='var dv=document.getElementById(\"d48050\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/email\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d48050' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50695' onclick='var dv=document.getElementById(\"d50695\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/data\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50695' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50702' onclick='var dv=document.getElementById(\"d50702\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/flag\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50702' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50720' onclick='var dv=document.getElementById(\"d50720\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/zip\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50720' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50731' onclick='var dv=document.getElementById(\"d50731\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/keyboard\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50731' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Regarding yesterday&#8217;s PHP City Guess Country Game Zip Tutorial&#8216;s web application, like many others, most people would say there is available to them, input wise, and once they have started it up from the web browser address bar &#8230; mouse &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-city-guess-country-game-keyboard-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[2419,2698,1824,3232,2081,2247,283,290,367,380,382,385,2242,452,476,477,576,2487,2395,3266,652,673,812,1705,2337,932,997,1022,3420,1294,1319,1497],"class_list":["post-50731","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-aesthetics","tag-carriage-return","tag-character","tag-city","tag-country","tag-country-code","tag-csv","tag-data","tag-dropdown","tag-email","tag-email-form","tag-emoji","tag-flag","tag-form","tag-game","tag-games-2","tag-html","tag-inline","tag-iso","tag-iso-code","tag-javascript","tag-keyboard","tag-mouse","tag-onkeydown","tag-onkeypress","tag-php","tag-programming","tag-quiz","tag-return","tag-touch","tag-tutorial","tag-zip"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50731"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=50731"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50731\/revisions"}],"predecessor-version":[{"id":50739,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50731\/revisions\/50739"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=50731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=50731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=50731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}