{"id":65930,"date":"2024-12-08T03:01:00","date_gmt":"2024-12-07T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=65930"},"modified":"2024-12-08T05:47:53","modified_gmt":"2024-12-07T19:47:53","slug":"php-intl-class-currency-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-intl-class-currency-primer-tutorial\/","title":{"rendered":"PHP Intl Class Currency Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_cur_eg.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Intl Class Currency Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/i_cur_eg.jpg\" title=\"PHP Intl Class Currency Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Intl Class Currency Primer Tutorial<\/p><\/div>\n<p>We&#8217;re back with the PHP <a target=\"_blank\" href='https:\/\/www.php.net\/manual\/en\/book.intl.php' rel=\"noopener\">intl<\/a> <font size=1>&#8220;Internationalization&#8221;<\/font> class, today, last talked about with the recent <a title='PHP Intl Class Datetime Keyboard Events Tutorial' href='#phpicdket'>PHP Intl Class Datetime Keyboard Events Tutorial<\/a>, this time discussing &#8230;<\/p>\n<blockquote><p>\nCurrency Internationalization\n<\/p><\/blockquote>\n<p> &#8230; topics.  Again, we found the Locale data item, as with Datetimes, the main data item of interest.  But, any one Country can use more than one Currency (defined by an <a target=\"_blank\" title='ISO-4217 3 letter Currency Code' href='https:\/\/www.iso.org\/iso-4217-currency-codes.html' rel=\"noopener\">ISO-4217 3 letter Currency Code<\/a>) in this new <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_cur_eg.php\" rel=\"noopener\">PHP Intl using Currency web application<\/a> we&#8217;ve started developing today, and on a Locale selection we choose the first such one, and leave it open to the user to be able to type in their own ISO-4217 three letter Currency Code, as required.<\/p>\n<p>We got great help from <a target=\"_blank\" title='https:\/\/stackoverflow.com\/questions\/76825595\/php-format-currency-issue' href='\/\/stackoverflow.com\/questions\/76825595\/php-format-currency-issue' rel=\"noopener\">https:\/\/stackoverflow.com\/questions\/76825595\/php-format-currency-issue<\/a> with codeline ideas, such as &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n $formatter = new NumberFormatter(urldecode($_GET['locale']), NumberFormatter::CURRENCY);<br \/>\n if (isset($_GET['amount'])) {<br \/>\n  echo \"&lt;p id=pdfmt&gt;\" . $formatter-&gt;formatCurrency(urldecode($_GET['amount']),  urldecode($_GET['currency'])) . \"&lt;\/p&gt;&lt;br&gt;\";<br \/>\n } else {<br \/>\n  echo \"&lt;p id=pdfmt&gt;\" . $formatter-&gt;formatCurrency(76543.210,  urldecode($_GET['currency'])) . \"&lt;\/p&gt;&lt;br&gt;\";<br \/>\n }<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p>The work of Datetimes, ahead of all this, has meant it is easier to get &#8220;further down the track&#8221; for today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_cur_eg.php_GETME\" rel=\"noopener\">&#8220;proof of concept&#8221; i_cur_eg.php<\/a> PHP code start, that has keyboard event and dropdown logics all in there, and which you can try below &#8230;<\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/i_cur_eg.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-intl-class-currency-primer-tutorial\/' rel=\"noopener\">PHP Intl Class Currency Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpicdket'>Previous relevant <a target=\"_blank\" title='PHP Intl Class Datetime Keyboard Events Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-intl-class-datetime-keyboard-events-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Keyboard Events Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Intl Class Datetime Keyboard Events Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/i_eg_key.jpg\" title=\"PHP Intl Class Datetime Keyboard Events Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Intl Class Datetime Keyboard Events Tutorial<\/p><\/div>\n<p>As far as &#8220;user interaction&#8221; goes with our Current Datetime PHP web application of <a title='PHP Intl Class Datetime Google Translate Tutorial' href='#phpicdgtt'>PHP Intl Class Datetime Google Translate Tutorial<\/a> we&#8217;ve been thinking &#8230;<\/p>\n<ul>\n<li>the user would be more likely to use the dropdown element selection methods &#8230; but supposing &#8230;<\/li>\n<li>the user uses the keyboard to enter Locale and\/or Timezone<\/li>\n<\/ul>\n<p> &#8230; and, as of yesterday&#8217;s logic, that would have been quite unwieldy, especially regarding timezone entries.<\/p>\n<p>And so, today, we&#8217;ve added keyboard <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeydown<\/i> and <i>oninput<\/i> event<\/a> logics to cater for several scenarios we can &#8220;shortcut&#8221; those user requirements, often down to the entry of a couple or a few characters, and from there click appropriate created links in &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\nvar morechanges=true;<br \/>\nvar lastwo='';<br \/>\nvar woi=null;<br \/>\nvar oko=null;<br \/>\nvar nlastokn='';<br \/>\nvar xokn='';<br \/>\nvar xlastconto=[];<br \/>\nvar xmorechanges=true;<br \/>\nvar xlastwo='';<br \/>\nvar xwoi=null;<br \/>\nvar xoko=null;<br \/>\n<br \/>\nfunction precval(iois) {<br \/>\n  \/\/okn=iois.value;<br \/>\n  oko=iois;<br \/>\n  lastokn=okn;<br \/>\n}<br \/>\n<br \/>\nfunction xprecval(iois) {<br \/>\n  \/\/okn=iois.value;<br \/>\n  xoko=iois;<br \/>\n  xlastokn=xokn;<br \/>\n}<br \/>\n<br \/>\nfunction cval(eiois) {<br \/>\n \/\/if (document.URL.indexOf('i0=') == -1) {<br \/>\n    \/\/if (eiois.which != 16) { alert('2:' + eiois.which); }<br \/>\n    \/\/okn+=String.fromCharCode(eiois.which || eiois.keyCode);<br \/>\n    if ((eiois.which || eiois.keyCode) == 8) {<br \/>\n    okn='';<br \/>\n    } else if ((eiois.which || eiois.keyCode) == 186 || (eiois.which || eiois.keyCode) == 900000016) {<br \/>\n    okn=okn.replace(':','') + ':';<br \/>\n    \/\/document.title=okn + ' ' + (eiois.which || eiois.keyCode);<br \/>\n    var cvi=okn.split(':');<br \/>\n    if (cvi.length &gt; 1) {<br \/>\n       var scs=0.0, factor=1.0;<br \/>\n       for (var ij=eval(-1 + cvi.length); ij&gt;=0; ij--) {<br \/>\n         if (cvi[ij] == '') cvi[ij]='00';<br \/>\n         scs+=eval(factor * eval(cvi[ij]));<br \/>\n         factor*=60.0;<br \/>\n       }<br \/>\n       \/\/alert(scs + ' ' + okn);<br \/>\n       okn='' + scs;<br \/>\n       oko.value=okn;<br \/>\n       lastokn=okn.replace(':','');<br \/>\n       \/\/document.title=okn + ' ' + (eiois.which || eiois.keyCode) + ' ' + oko.value;<br \/>\n       \/\/setTimeout(fixval,30);<br \/>\n    }<br \/>\n    } else if ((eiois.which || eiois.keyCode) == 191) {<br \/>\n       if (!eiois.shiftKey) {<br \/>\n       okn+=String.fromCharCode(47);<br \/>\n       \/\/document.title='=1:' + okn + '+' + eiois.which + ' ' + eiois.keyCode + ' ... ';<br \/>\n       }<br \/>\n       if (eval('' + okn.length) &gt; 1) { expandokn(); }<br \/>\n    } else if ((eiois.which || eiois.keyCode) == 189) {<br \/>\n       if (eiois.shiftKey) {<br \/>\n       okn+=String.fromCharCode(95);<br \/>\n       } else {<br \/>\n       okn+=String.fromCharCode(45);<br \/>\n       }<br \/>\n       if (eval('' + okn.length) &gt; 1) { expandokn(); }<br \/>\n       \/\/document.title='=1:' + okn + '+' + eiois.which + ' ' + eiois.keyCode + ' ... ';<br \/>\n    } else if (eiois.keyCode == 189 || (eiois.which || eiois.keyCode) &gt;= 65 && (eiois.which || eiois.keyCode) &lt;= 90) {<br \/>\n       if (eiois.shiftKey) {<br \/>\n       okn+=String.fromCharCode(eiois.which || eiois.keyCode);<br \/>\n       } else {<br \/>\n       okn+=String.fromCharCode(eval(32 + eval(eiois.which || eiois.keyCode)));<br \/>\n       }<br \/>\n       \/\/document.title='=1:' + okn + '+' + eiois.which + ' ' + eiois.keyCode + ' ... ';<br \/>\n       if (eval('' + okn.length) &gt; 1) { expandokn(); }<br \/>\n    } else if ((eiois.which || eiois.keyCode) &lt; 46 || (eiois.which || eiois.keyCode) &gt; 58) {<br \/>\n    okn=okn;<br \/>\n    } else if (1 == 3) {<br \/>\n       okn+=String.fromCharCode(eiois.which || eiois.keyCode);<br \/>\n       document.title+='=1:' + okn + '+' + eiois.which + ' ' + eiois.keyCode + ' ... ';<br \/>\n    }<br \/>\n \/\/}<br \/>\n}<br \/>\n<br \/>\nfunction xcval(eiois) {<br \/>\n \/\/if (document.URL.indexOf('i0=') == -1) {<br \/>\n    \/\/if (eiois.which != 16) { alert('1:' + eiois.which); }<br \/>\n    \/\/xokn+=String.fromCharCode(eiois.which || eiois.keyCode);<br \/>\n    if ((eiois.which || eiois.keyCode) == 8) {<br \/>\n    xokn='';<br \/>\n    } else if ((eiois.which || eiois.keyCode) == 186 || (eiois.which || eiois.keyCode) == 900000016) {<br \/>\n    xokn=xokn.replace(':','') + ':';<br \/>\n    \/\/document.title=okn + ' ' + (eiois.which || eiois.keyCode);<br \/>\n    var cvi=xokn.split(':');<br \/>\n    if (cvi.length &gt; 1) {<br \/>\n       var scs=0.0, factor=1.0;<br \/>\n       for (var ij=eval(-1 + cvi.length); ij&gt;=0; ij--) {<br \/>\n         if (cvi[ij] == '') cvi[ij]='00';<br \/>\n         scs+=eval(factor * eval(cvi[ij]));<br \/>\n         factor*=60.0;<br \/>\n       }<br \/>\n       \/\/alert(scs + ' ' + okn);<br \/>\n       xokn='' + scs;<br \/>\n       xoko.value=xokn;<br \/>\n       xlastokn=xokn.replace(':','');<br \/>\n       \/\/document.title=okn + ' ' + (eiois.which || eiois.keyCode) + ' ' + oko.value;<br \/>\n       \/\/setTimeout(fixval,30);<br \/>\n    }<br \/>\n    } else if ((eiois.which || eiois.keyCode) == 191) {<br \/>\n       if (!eiois.shiftKey) {<br \/>\n       xokn+=String.fromCharCode(47);<br \/>\n       \/\/document.title='=2:' + xokn + '+' + eiois.which + ' ' + eiois.keyCode + ' ... ';<br \/>\n       }<br \/>\n       if (eval('' + xokn.length) &gt; 1) { expandxokn(); }<br \/>\n    } else if ((eiois.which || eiois.keyCode) == 189) {<br \/>\n       if (eiois.shiftKey) {<br \/>\n       xokn+=String.fromCharCode(95);<br \/>\n       } else {<br \/>\n       xokn+=String.fromCharCode(45);<br \/>\n       }<br \/>\n       if (eval('' + xokn.length) &gt; 1) { expandxokn(); }<br \/>\n       \/\/document.title='=2:' + xokn + '+' + eiois.which + ' ' + eiois.keyCode + ' ... ';<br \/>\n    } else if (eiois.keyCode == 189 || (eiois.which || eiois.keyCode) &gt;= 65 && (eiois.which || eiois.keyCode) &lt;= 90) {<br \/>\n       if (eiois.shiftKey) {<br \/>\n       xokn+=String.fromCharCode(eiois.which || eiois.keyCode);<br \/>\n       } else {<br \/>\n       xokn+=String.fromCharCode(eval(32 + eval(eiois.which || eiois.keyCode)));<br \/>\n       }<br \/>\n       if (eval('' + xokn.length) &gt; 1) { expandxokn(); }<br \/>\n       \/\/document.title='=2:' + xokn + '+' + eiois.which + ' ' + eiois.keyCode + ' ... ';<br \/>\n    } else if ((eiois.which || eiois.keyCode) &lt; 46 || (eiois.which || eiois.keyCode) &gt; 58) {<br \/>\n    xokn=xokn;<br \/>\n    } else if (1 == 3) {<br \/>\n       xokn+=String.fromCharCode(eiois.which || eiois.keyCode);<br \/>\n       document.title+='=' + xokn + '+' + eiois.which + ' ' + eiois.keyCode + ' ... ';<br \/>\n    }<br \/>\n \/\/}<br \/>\n}<br \/>\n<br \/>\n  function expandokn() {<br \/>\n    var iut=0, pls=[],firsttz='',tzsih='',xtzsih='',thatloc='', wds=[];<br \/>\n    if (okn.substring(0,1) == okn.substring(0,1).toUpperCase() && okn != okn.toUpperCase()) {<br \/>\n      document.getElementById('das').innerHTML='Country Name&lt;br&gt;';<br \/>\n      pls=ctynames.split('&gt;' + okn);<br \/>\n      if (eval('' + pls.length) &gt; 1) {<br \/>\n       \/\/alert('here');<br \/>\n       for (iut=1; iut&lt;pls.length; iut++) {<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analp(this,0); title=' + pls[eval(-1 + iut)].slice(-4) + ' style=cursor:pointer;text-decoration:underline;&gt;' + okn + pls[iut].split('&lt;')[0] + ' ' + jorflag(pls[eval(-1 + iut)].slice(-3).substring(0,2)) + '&lt;\/a&gt;';<br \/>\n       }<br \/>\n      }<br \/>\n    } else if (okn.substring(0,1) == okn.substring(0,1).toLowerCase() && okn == okn.toLowerCase()) {<br \/>\n      xtzsih=document.getElementById('tzsel').innerHTML;<br \/>\n      document.getElementById('das').innerHTML+='&lt;br&gt;&lt;br&gt;Locale&lt;br&gt;';<br \/>\n      tzsih=document.getElementById('locsel').innerHTML;<br \/>\n      \/\/alert(tzsih.length);<br \/>\n      pls=tzsih.split( value='\\\"' + okn);<br \/>\n      if (eval('' + pls.length) &gt; 1) {<br \/>\n       \/\/alert('here');<br \/>\n       for (iut=1; iut&lt;pls.length; iut++) {<br \/>\n        thatloc=pls[iut].split('&gt;')[1].split('&lt;')[0].split(' ')[0].split('+')[0];<br \/>\n        wds=thatloc.split('_');<br \/>\n        if (eval('' + wds[eval(-1 + wds.length)].length) == 2 && wds[eval(-1 + wds.length)] == wds[eval(-1 + wds.length)].toUpperCase() && eval('' + wds.length) &gt; 1) {<br \/>\n        \/\/alert('1:' + wds[eval(-1 + wds.length)]);<br \/>\n      firsttz='';<br \/>\n      if (xtzsih.indexOf(',' + wds[eval(-1 + wds.length)] + ',') != -1) {<br \/>\n      firsttz=xtzsih.split(',' + wds[eval(-1 + wds.length)] + ',')[1].split('&gt;')[1].split('&lt;')[0].split(' ')[0];<br \/>\n        \/\/alert('2:' + firsttz);<br \/>\n      }<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analr(this,\\\"' + firsttz + '\\\"); style=cursor:pointer;text-decoration:underline;&gt;' + thatloc + ' ' + jorflag(wds[eval(-1 + wds.length)]) + '&lt;\/a&gt;';<br \/>\n        } else {<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analr(this,\\\"\\\"); style=cursor:pointer;text-decoration:underline;&gt;' + thatloc + '&lt;\/a&gt;';<br \/>\n        }<br \/>\n       }<br \/>\n      }<br \/>\n    <br \/>\n    } else if (okn.substring(0,1) == okn.substring(0,1).toUpperCase() && okn == okn.toUpperCase() && eval('' + okn.length) == 2) {<br \/>\n      document.getElementById('das').innerHTML='Country Name&lt;br&gt;';<br \/>\n      pls=ctynames.split(\\\"'\\\" + okn + \\\"'&gt;\\\");<br \/>\n      if (eval('' + pls.length) &gt; 1) {<br \/>\n       \/\/alert('here');<br \/>\n       for (iut=1; iut&lt;pls.length; iut++) {<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analp(this,0); title=' + okn + ' style=cursor:pointer;text-decoration:underline;&gt;' + pls[iut].split('&lt;')[0] + ' ' + jorflag(okn) + '&lt;\/a&gt;';<br \/>\n       }<br \/>\n      }<br \/>\n      <br \/>\n      tzsih=document.getElementById('tzsel').innerHTML;<br \/>\n      if (tzsih.indexOf(',' + okn + ',') != -1) {<br \/>\n      firsttz=tzsih.split(',' + okn + ',')[1].split('&gt;')[1].split('&lt;')[0].split(' ')[0];<br \/>\n      }<br \/>\n      document.getElementById('das').innerHTML+='&lt;br&gt;&lt;br&gt;Locale&lt;br&gt;';<br \/>\n      tzsih=document.getElementById('locsel').innerHTML;<br \/>\n      \/\/alert(tzsih.length);<br \/>\n      pls=tzsih.split('_' + okn + '\\\"');<br \/>\n      if (eval('' + pls.length) &gt; 1) {<br \/>\n       \/\/alert('here');<br \/>\n       for (iut=1; iut&lt;pls.length; iut++) {<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analr(this,\\\"' + firsttz + '\\\"); style=cursor:pointer;text-decoration:underline;&gt;' + pls[iut].split('&gt;')[1].split('&lt;')[0].split(' ')[0].split('+')[0] + ' ' + jorflag(okn) + '&lt;\/a&gt;';<br \/>\n       }<br \/>\n      }<br \/>\n      <br \/>\n    }<br \/>\n  }<br \/>\n<br \/>\n  function expandxokn() {<br \/>\n    var iut=0, pls=[], tzsih='', thattz='';<br \/>\n    if (xokn.substring(0,1) == xokn.substring(0,1).toUpperCase() && xokn != xokn.toUpperCase()) {<br \/>\n      document.getElementById('das').innerHTML='TimeZone Place Name&lt;br&gt;';<br \/>\n      tzsih=document.getElementById('tzsel').innerHTML;<br \/>\n      \/\/alert(tzsih.length);<br \/>\n      pls=tzsih.split('\/' + xokn);<br \/>\n      if (eval('' + pls.length) &gt; 1) {<br \/>\n       \/\/alert('here');<br \/>\n       for (iut=1; iut&lt;pls.length; iut+=2) {<br \/>\n        if (pls[iut].split('\\\"')[0].indexOf('\/') == -1) {<br \/>\n        thattz=pls[iut].split('&gt;')[1].split('&lt;')[0].split(' ')[0].split('+')[0].split('\/' + xokn)[0] + '\/' + xokn + pls[iut].split('\\\"')[0];<br \/>\n        if (eval('' + tzsih.split(thattz)[1].split(' data-geo=')[1].split(',').length) &gt; 3) {<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analo(this); style=cursor:pointer;text-decoration:underline;&gt;' + pls[iut].split('&gt;')[1].split('&lt;')[0].split(' ')[0].split('+')[0].split('\/' + xokn)[0] + '\/' + xokn + pls[iut].split('\\\"')[0] + ' ' + jorflag(tzsih.split(thattz)[1].split(' data-geo=')[1].split(',')[3]) + '&lt;\/a&gt;';<br \/>\n        } else {<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analo(this); style=cursor:pointer;text-decoration:underline;&gt;' + pls[iut].split('&gt;')[1].split('&lt;')[0].split(' ')[0].split('+')[0].split('\/' + xokn)[0] + '\/' + xokn + pls[iut].split('\\\"')[0] + '&lt;\/a&gt;';<br \/>\n        }<br \/>\n        }<br \/>\n       }<br \/>\n      }<br \/>\n      document.getElementById('das').innerHTML+='&lt;br&gt;&lt;br&gt;Country Name&lt;br&gt;';<br \/>\n      pls=ctynames.split('&gt;' + xokn);<br \/>\n      if (eval('' + pls.length) &gt; 1) {<br \/>\n       \/\/alert('here');<br \/>\n       for (iut=1; iut&lt;pls.length; iut++) {<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analp(this,1); title=' + pls[eval(-1 + iut)].slice(-4) + ' style=cursor:pointer;text-decoration:underline;&gt;' + xokn + pls[iut].split('&lt;')[0] + ' ' + jorflag(pls[eval(-1 + iut)].slice(-3).substring(0,2)) + '&lt;\/a&gt;';<br \/>\n       }<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n  <br \/>\n  function analr(ao,tzi) { \/\/ locale<br \/>\n    if (ao.innerHTML.indexOf('_') != -1) {<br \/>\n       document.getElementById('locsel').value=ao.innerHTML.split(' ')[0];<br \/>\n       document.getElementById('locale').value=ao.innerHTML.split(' ')[0];<br \/>\n       document.getElementById('timezone').value=tzi.split(' ')[0];<br \/>\n       document.getElementById('das').innerHTML='';<br \/>\n       okn='';<br \/>\n    }<br \/>\n  }<br \/>\n  <br \/>\n  function analq(ao,tzi) { \/\/ locale<br \/>\n    if (ao.innerHTML.indexOf('_') != -1) {<br \/>\n       document.getElementById('locsel').value=ao.innerHTML.split(' ')[0];<br \/>\n       document.getElementById('locale').value=ao.innerHTML.split(' ')[0];<br \/>\n       document.getElementById('timezone').value=tzi.split(' ')[0];<br \/>\n       document.getElementById('das').innerHTML='';<br \/>\n       xokn='';<br \/>\n       okn='';<br \/>\n    }<br \/>\n  }<br \/>\n  <br \/>\n  function analo(ao) { \/\/ timezone places<br \/>\n    if (ao.innerHTML.indexOf('\/') != -1) {<br \/>\n       document.getElementById('tzsel').value=ao.innerHTML.split(' ')[0];<br \/>\n       document.getElementById('timezone').value=ao.innerHTML.split(' ')[0];<br \/>\n       document.getElementById('das').innerHTML='';<br \/>\n       xokn='';<br \/>\n    }<br \/>\n  }<br \/>\n  <br \/>\n  function analp(ao,isxokn) { \/\/ country names<br \/>\n    var tzsih='',pls=[],iut=0, firsttz='', thattz='';<br \/>\n    if (ao.innerHTML.indexOf('\/') != -1) {<br \/>\n      document.getElementById('tzsel').value=ao.innerHTML.split(' ')[0];<br \/>\n      document.getElementById('timezone').value=ao.innerHTML.split(' ')[0];<br \/>\n      document.getElementById('das').innerHTML='';<br \/>\n      if (isxokn != 0) {<br \/>\n      xokn='';<br \/>\n      } else {<br \/>\n      okn='';<br \/>\n      }<br \/>\n    } else {<br \/>\n      document.getElementById('das').innerHTML+='&lt;br&gt;&lt;br&gt;TimeZone Place Name&lt;br&gt;';<br \/>\n      tzsih=document.getElementById('tzsel').innerHTML;<br \/>\n      \/\/alert(tzsih.length);<br \/>\n      pls=tzsih.split(',' + ao.title.split(' ')[0] + ',');<br \/>\n      if (eval('' + pls.length) &gt; 1) {<br \/>\n       \/\/alert('here');<br \/>\n       for (iut=1; iut&lt;pls.length; iut++) {<br \/>\n        if (firsttz == '') {  firsttz=pls[iut].split('&gt;')[1].split('&lt;')[0].split(' ')[0].split('+')[0];  }<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analo(this); style=cursor:pointer;text-decoration:underline;&gt;' + pls[iut].split('&gt;')[1].split('&lt;')[0].split(' ')[0].split('+')[0] + ' ' + jorflag(ao.title.split(' ')[0]) + '&lt;\/a&gt;';<br \/>\n       }<br \/>\n      }<br \/>\n<br \/>\n      document.getElementById('das').innerHTML+='&lt;br&gt;&lt;br&gt;Locale&lt;br&gt;';<br \/>\n      tzsih=document.getElementById('locsel').innerHTML;<br \/>\n      \/\/alert(tzsih.length);<br \/>\n      pls=tzsih.split('_' + ao.title.split(' ')[0] + '\\\"');<br \/>\n      if (eval('' + pls.length) &gt; 1) {<br \/>\n       \/\/alert('here');<br \/>\n       for (iut=1; iut&lt;pls.length; iut++) {<br \/>\n        document.getElementById('das').innerHTML+=' &lt;a onclick=analq(this,\\\"' + firsttz + '\\\"); style=cursor:pointer;text-decoration:underline;&gt;' + pls[iut].split('&gt;')[1].split('&lt;')[0].split(' ')[0].split('+')[0] + ' ' + jorflag(ao.title.split(' ')[0]) + '&lt;\/a&gt;';<br \/>\n       }<br \/>\n      }<br \/>\n<br \/>\n      xokn='';<br \/>\n    }<br \/>\n  }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/i_eg.php---GETME\" rel=\"noopener\">further changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php---GETME\" rel=\"noopener\">latest draft<\/a> PHP code offering here, as a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\">PHP web application<\/a>, you <a href='#myiflt'>can also try below<\/a>.<\/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-intl-class-datetime-keyboard-events-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Keyboard Events Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpicdgtt'>Previous relevant <a target=\"_blank\" title='PHP Intl Class Datetime Google Translate Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-intl-class-datetime-google-translate-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Google Translate Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Intl Class Datetime Google Translate Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/i_eg_gt.gif\" title=\"PHP Intl Class Datetime Google Translate Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Intl Class Datetime Google Translate Tutorial<\/p><\/div>\n<p>The Internationalization improvements of yesterday&#8217;s <a title='PHP Intl Class Datetime Clock Tutorial' href='#phpicdct'>PHP Intl Class Datetime Clock Tutorial<\/a> get another boost today via the inclusion of some interfacing to the great &#8230;<\/p>\n<p><code><br \/>\n<a target=\"_blank\" titel='Google Translate' href='\/\/translate.google.com' rel=\"noopener\">Google Translate<\/a><br \/>\n<\/code><\/p>\n<p> &#8230; for those incidental translations regarding &#8230;<\/p>\n<ul>\n<li>titles and headings<\/li>\n<li>dropdown instructions<\/li>\n<\/ul>\n<p> &#8230; while avoiding what might add confusion, that being any translation of user web application settings, as you might get &#8230; you being the user &#8230; <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=PtR4cWb4HNg' rel=\"noopener\">that is<\/a>!<\/p>\n<p>But we ask first on this. And when it is the case for asking here, a useful mechanism can be the HTML input type=checkbox element which now feeds into the Javascript below &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  function parhelp() {<br \/>\n    \" . $gone . \"<br \/>\n  }<br \/>\n<br \/>\n    function storeinnertexts() {<br \/>\n      if (!document.getElementById('translate').checked) { return ''; }<br \/>\n      if (!allowanyway) {<br \/>\n      if (document.getElementById('locale').value == '') { return ''; }<br \/>\n      if (document.getElementById('timezone').value == '') { return ''; }<br \/>\n      }<br \/>\n      var bcols=['yellow','yellow','white','#ffffff'];<br \/>\n      var idcnt=0;<br \/>\n      var seclet=['h translate=\\\"no\\\"','d','h translate=\\\"no\\\"','d','d translate=\\\"no\\\"','d','d','d'];<br \/>\n      var inb='', ina='&lt;\/span&gt;';<br \/>\n      var krow=0;<br \/>\n      var itsare=['locale','loptone','timezone','toptone','calendar','calone','doneb','Clock'], thisrowis='';<br \/>\n      var h1toform='&lt;html&gt;&lt;head&gt;&lt;body&gt;' + document.body.innerHTML.split('&lt;form')[0] + '&lt;br&gt;&lt;table style=width:100%; border=2&gt;&lt;\/table&gt;&lt;\/body&gt;&lt;\/html&gt;';<br \/>\n      for (var iuyt=0; iuyt&lt;itsare.length; iuyt+=2) {<br \/>\n        thisrowis='&lt;tr style=background-color:' + bcols[krow] + ';&gt;&lt;\/tr&gt;';<br \/>\n        thisrowis='&lt;tr&gt;&lt;\/tr&gt;';<br \/>\n        tdsuff='';<br \/>\n        inb='&lt;span&gt;';<br \/>\n        if (eval('' + seclet[idcnt].length) &gt; 1) {<br \/>\n        inb='&lt;span' + seclet[idcnt].substring(1) + '&gt;';<br \/>\n        }<br \/>\n        if (bcols[krow] == '#ffffff') {<br \/>\n          tdsuff=' style=background-color:lightgreen;'<br \/>\n        }<br \/>\n        if (document.getElementById(itsare[iuyt]).value.trim() != '' || 1 == 1) {<br \/>\n          thisrowis=thisrowis.replace('&lt;\/tr&gt;', '&lt;t' + seclet[idcnt].substring(0,1) + '&gt;' + inb + (inb == '&lt;span&gt;' ? document.getElementById(itsare[iuyt]).value : '') + ina + '&lt;\/t' + seclet[idcnt].substring(0,1) + '&gt;&lt;\/tr&gt;');<br \/>\n        } else {<br \/>\n          thisrowis=thisrowis.replace('&lt;\/tr&gt;', '&lt;t' + seclet[idcnt].substring(0,1) + '&gt;' + inb + (inb == '&lt;span&gt;' ? document.getElementById(itsare[iuyt]).placeholder : '') + ina + '&lt;\/t' + seclet[idcnt].substring(0,1) + '&gt;&lt;\/tr&gt;');<br \/>\n        }<br \/>\n        idcnt++;<br \/>\n        if (bcols[krow] == '#ffffff') {<br \/>\n          tdsuff=' style=background-color:#f0f0f0;'<br \/>\n        }<br \/>\n        inb='&lt;span&gt;';<br \/>\n        if (eval('' + seclet[idcnt].length) &gt; 1) {<br \/>\n        inb='&lt;span' + seclet[idcnt].substring(1) + '&gt;';<br \/>\n        }<br \/>\n        if (itsare[eval(1 + iuyt)] == itsare[eval(1 + iuyt)].toLowerCase()) {<br \/>\n        try {<br \/>\n        if (document.getElementById(itsare[eval(1 + iuyt)]).innerText.trim() != '') {<br \/>\n          \/\/if (doseti == 1) { alert(document.getElementById(itsare[eval(1 + iuyt)]).innerText); }<br \/>\n          thisrowis=thisrowis.replace('&lt;\/tr&gt;', '&lt;t' + seclet[idcnt].substring(0,1) + '&gt;' + inb + (inb == '&lt;span&gt;' ? document.getElementById(itsare[eval(1 + iuyt)]).innerText : '') + ina + '&lt;\/t' + seclet[idcnt].substring(0,1) + '&gt;&lt;\/tr&gt;');<br \/>\n        }<br \/>\n        } catch(erty) { alert(itsare[eval(1 + iuyt)]);  }<br \/>\n        } else {<br \/>\n        if (document.getElementById(itsare[eval(1 + iuyt)].toLowerCase()).value.trim() != '') {<br \/>\n          thisrowis=thisrowis.replace('&lt;\/tr&gt;', '&lt;t' + seclet[idcnt].substring(0,1) + '&gt;' + inb + (inb == '&lt;span&gt;' ? document.getElementById(itsare[eval(1 + iuyt)].toLowerCase()).value : '') + ina + '&lt;\/t' + seclet[idcnt].substring(0,1) + '&gt;&lt;\/tr&gt;');<br \/>\n        } else {<br \/>\n          thisrowis=thisrowis.replace('&lt;\/tr&gt;', '&lt;t' + seclet[idcnt].substring(0,1) + '&gt;' + inb + (inb == '&lt;span&gt;' ? document.getElementById(itsare[eval(1 + iuyt)].toLowerCase()).placeholder : '') + ina + '&lt;\/t' + seclet[idcnt].substring(0,1) + '&gt;&lt;\/tr&gt;');<br \/>\n        }<br \/>\n        }<br \/>\n        idcnt++;<br \/>\n        krow++;<br \/>\n        h1toform=h1toform.replace('&lt;\/table&gt;', thisrowis + '&lt;\/table&gt;');<br \/>\n      }<br \/>\n      \/\/if (doseti == 1) { alert(h1toform); }<br \/>\n        h1toform=h1toform.replace(\/Optionally\\ select\\ \/g, '*');<br \/>\n        h1toform=h1toform.replace(\/Show\\ Current\\ Time\/g, '@');<br \/>\n        h1toform=h1toform.replace('RJM Programming - December, 2024', '$');<br \/>\n        h1toform=h1toform.replace('As per (white background textboxes optional) ...', '!');<br \/>\n        h1toform=h1toform.replace(\/\\&lt;br\\&gt;\/g, '');<br \/>\n        h1toform=h1toform.replace('&lt;span translate=\\\"no\\\"&gt;&lt;\/span&gt;', '');<br \/>\n        h1toform=h1toform.replace('&lt;span translate=\\\"no\\\"&gt;&lt;\/span&gt;', '');<br \/>\n      \/\/if (doseti == 1) {   var tyr=prompt('' + (documentURL.split('?')[0] + '?sra=' + encodeURIComponent(sra) + '&it=' + encodeURIComponent(h1toform) + '&rand=' + Math.floor(Math.random() * 1987865)).length + ' ' + h1toform.replace(\/\\&lt;\\\/\/g, String.fromCharCode(10) + '&lt;\/'), h1toform.replace(\/\\&lt;\\\/\/g, String.fromCharCode(10) + '&lt;\/')); }<br \/>\n      document.getElementById('setiif').src=documentURL.split('?')[0] + '?sra=' + encodeURIComponent(sra) + '&it=' + encodeURIComponent(h1toform) + '&rand=' + Math.floor(Math.random() * 1987865);<br \/>\n      doseti++;<br \/>\n      return '';<br \/>\n    }<br \/>\n    <br \/>\n    function setitranslate() {<br \/>\n      if (doseti == 0) {<br \/>\n        doseti=1;<br \/>\n        setInterval(storeinnertexts, 2000);<br \/>\n      }<br \/>\n    }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; and the PHP &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n$gtwo='';<br \/>\n$delthis='';<br \/>\n$optcnt=0;<br \/>\n<br \/>\nif (isset($_GET['timezone'])) {<br \/>\n  $_GET['timezone']=explode('%20',explode('+', $_GET['timezone'])[0])[0];<br \/>\n} else if (isset($_POST['timezone'])) {<br \/>\n  $_POST['timezone']=explode('%20',explode('+', $_POST['timezone'])[0])[0];<br \/>\n}<br \/>\n<br \/>\nfunction user_agent() {   \/\/ thanks to https:\/\/stackoverflow.com\/questions\/6322112\/check-if-php-page-is-accessed-from-an-ios-device\/6322131<br \/>\n    $iPod = strpos($_SERVER['HTTP_USER_AGENT'],\"iPod\");<br \/>\n    $iPhone = strpos($_SERVER['HTTP_USER_AGENT'],\"iPhone\");<br \/>\n    $iPad = strpos($_SERVER['HTTP_USER_AGENT'],\"iPad\");<br \/>\n    $android = strpos($_SERVER['HTTP_USER_AGENT'],\"Android\");<br \/>\n    \/\/file_put_contents('.\/public\/upload\/install_log\/agent',$_SERVER['HTTP_USER_AGENT']);<br \/>\n    if ($iPad||$iPhone||$iPod) {<br \/>\n        return 'ios';<br \/>\n    } else if ($android) {<br \/>\n        return 'android';<br \/>\n    } else {<br \/>\n        return 'pc';<br \/>\n    }<br \/>\n}<br \/>\n<br \/>\nfunction server_remote_addr() {<br \/>\n    $rma = $_SERVER['REMOTE_ADDR'];<br \/>\n    $ua = strtolower($_SERVER['HTTP_USER_AGENT']);<br \/>\n    \/\/ you can add different browsers with the same way ..<br \/>\n    if (1 == 1) {<br \/>\n    if(preg_match('\/(chromium)[ \\\/]([\\w.]+)\/', $ua))<br \/>\n            $rma = '000000'.$rma;<br \/>\n    elseif(preg_match('\/(chrome)[ \\\/]([\\w.]+)\/', $ua))<br \/>\n            $rma = '00000'.$rma;<br \/>\n    elseif(preg_match('\/(safari)[ \\\/]([\\w.]+)\/', $ua))<br \/>\n            $rma = '0000'.$rma;<br \/>\n    elseif(preg_match('\/(opera)[ \\\/]([\\w.]+)\/', $ua))<br \/>\n            $rma = '000'.$rma;<br \/>\n    elseif(preg_match('\/(msie)[ \\\/]([\\w.]+)\/', $ua))<br \/>\n            $rma = '00'.$rma;<br \/>\n    elseif(preg_match('\/(mozilla)[ \\\/]([\\w.]+)\/', $ua))<br \/>\n            $rma = '0'.$rma;<br \/>\n    }<br \/>\n    return str_replace(':','_',str_replace('.','_',$rma));<br \/>\n}<br \/>\n<br \/>\nif (isset($_GET['sra']) && isset($_GET['it'])) {<br \/>\n  \/\/if (file_exists($_SERVER['DOCUMENT_ROOT'] . '\/html_intl_' . str_replace('+',' ',urldecode($_GET['sra'])) . '.html')) {<br \/>\n  \/\/  exec('rm -f ' . $_SERVER['DOCUMENT_ROOT'] . '\/html_intl_' . str_replace('+',' ',urldecode($_GET['sra'])) . '.html');<br \/>\n  \/\/}<br \/>\n  $wopenit=false;<br \/>\n  if (!file_exists($_SERVER['DOCUMENT_ROOT'] . '\/html_intl_' . str_replace('+',' ',urldecode($_GET['sra'])) . '.html')) {<br \/>\n    $wopenit=true;<br \/>\n  }<br \/>\n  $cont=str_replace('+',' ',urldecode($_GET['it']));<br \/>\n  $cont=str_replace('*', 'Optionally select ', $cont);<br \/>\n  $cont=str_replace('@', 'Show Current Time', $cont);<br \/>\n  $cont=str_replace('$', 'RJM Programming - December, 2024', $cont);<br \/>\n  $cont=str_replace('!', 'As per (white background textboxes optional) ...', $cont);<br \/>\n  $cont=str_replace('&lt;\/body&gt;', '&lt;style&gt; th { background-color:yellow;  } &lt;\/style&gt;&lt;\/body&gt;', $cont);<br \/>\n  file_put_contents($_SERVER['DOCUMENT_ROOT'] . '\/html_intl_' . str_replace('+',' ',urldecode($_GET['sra'])) . '.html', $cont);<br \/>\n  if ($wopenit) {<br \/>\n    echo \"&lt;html&gt;&lt;body onload=\\\" parent.parhelp(); \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n  }<br \/>\n  exit;<br \/>\n} else if (isset($_POST['sra']) && isset($_POST['it'])) {<br \/>\n  \/\/if (file_exists($_SERVER['DOCUMENT_ROOT'] . '\/html_intl_' . str_replace('+',' ',urldecode($_POST['sra'])) . '.html')) {<br \/>\n  \/\/  exec('rm -f ' . $_SERVER['DOCUMENT_ROOT'] . '\/html_intl_' . str_replace('+',' ',urldecode($_POST['sra'])) . '.html');<br \/>\n  \/\/}<br \/>\n  $wopenit=false;<br \/>\n  if (!file_exists($_SERVER['DOCUMENT_ROOT'] . '\/html_intl_' . str_replace('+',' ',urldecode($_POST['sra'])) . '.html')) {<br \/>\n    $wopenit=true;<br \/>\n  }<br \/>\n  $cont=str_replace('+',' ',urldecode($_POST['it']));<br \/>\n  $cont=str_replace('*', 'Optionally select ', $cont);<br \/>\n  $cont=str_replace('@', 'Show Current Time', $cont);<br \/>\n  $cont=str_replace('$', 'RJM Programming - December, 2024', $cont);<br \/>\n  $cont=str_replace('!', 'As per (white background textboxes optional) ...', $cont);<br \/>\n  $cont=str_replace('&lt;\/body&gt;', '&lt;style&gt; th { background-color:yellow;  } &lt;\/style&gt;&lt;\/body&gt;', $cont);<br \/>\n  file_put_contents($_SERVER['DOCUMENT_ROOT'] . '\/html_intl_' . str_replace('+',' ',urldecode($_POST['sra'])) . '.html', $cont);<br \/>\n  if ($wopenit) {<br \/>\n    echo \"&lt;html&gt;&lt;body onload=\\\" parent.parhelp(); \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n  }<br \/>\n  exit;<br \/>\n}<br \/>\n<br \/>\n$gone=\"\\n setTimeout(function(){ if ((document.getElementById('locale').value + document.getElementById('locale').placeholder).split('_')[0].split('-')[0] != 'en') { gtwoo=window.open('https:\/\/www-rjmprogramming-com-au.translate.goog\/html_intl_\" . server_remote_addr() . \".html?_x_tr_sch=https&_x_tr_sl=en&_x_tr_tl=' + (document.getElementById('locale').value + document.getElementById('locale').placeholder).split('_')[0].split('-')[0] + '&_x_tr_hl=en','_blank','top=200,left=' + eval(-500 + eval('' + screen.width)) + ',width=500,height=500'); } }, 7000); \\n\";<br \/>\n<br \/>\n\/\/ https:\/\/www-rjmprogramming-com-au.translate.goog\/PHP\/GeoChart\/image_chart.php?_x_tr_sch=https&_x_tr_sl=en&_x_tr_tl=it&_x_tr_hl=en<br \/>\nif (isset($_GET['translate']) && isset($_GET['locale'])) {<br \/>\n  if (strlen($_GET['locale']) &gt; 0) {<br \/>\n    $delthis=$_SERVER['DOCUMENT_ROOT'] . \"\/html_intl_\" . server_remote_addr() . \".html\";<br \/>\n    if (explode('-',explode('_',urldecode($_GET['locale']))[0])[0] != 'en') {<br \/>\n    $gtwo=\"\\n setTimeout(function(){ gtwoo=window.open('https:\/\/www-rjmprogramming-com-au.translate.goog\/html_intl_\" . server_remote_addr() . \".html?_x_tr_sch=https&_x_tr_sl=en&_x_tr_tl=\" . explode('-',explode('_',urldecode($_GET['locale']))[0])[0] . \"&_x_tr_hl=en','_blank','top=200,left=' + eval(-500 + eval('' + screen.width)) + ',width=500,height=500'); }, 7000); \\n\";<br \/>\n    }<br \/>\n  }<br \/>\n} else if (isset($_POST['translate']) && isset($_POST['locale'])) {<br \/>\n  if (strlen($_POST['locale']) &gt; 0) {<br \/>\n    $delthis=$_SERVER['DOCUMENT_ROOT'] . \"\/html_intl_\" . server_remote_addr() . \".html\";<br \/>\n    if (explode('-',explode('_',urldecode($_POST['locale']))[0])[0] != 'en') {<br \/>\n    $gtwo=\"\\n setTimeout(function(){  gtwoo=window.open('https:\/\/www-rjmprogramming-com-au.translate.goog\/html_intl_\" . server_remote_addr() . \".html?_x_tr_sch=https&_x_tr_sl=en&_x_tr_tl=\" . explode('-',explode('_',urldecode($_POST['locale']))[0])[0] . \"&_x_tr_hl=en','_blank','top=200,left=' + eval(-500 + eval('' + screen.width)) + ',width=500,height=500'); }, 7000); \\n\";<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; to make this a possibility in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/i_eg.php---GETME\" rel=\"noopener\">a changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php---GETME\" rel=\"noopener\">&#8220;fourth draft&#8221;<\/a> PHP code offering here, as a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\">PHP web application<\/a>, you <a href='#myiflt'>can also try below<\/a>.<\/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\/new-php-intl-class-datetime-google-translate-tutorial\/' rel=\"noopener\">New PHP Intl Class Datetime Google Translate Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpicdct'>Previous relevant <a target=\"_blank\" title='PHP Intl Class Datetime Clock Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-intl-class-datetime-clock-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Clock Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Intl Class Datetime Clock Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/i_eg_better.gif\" title=\"PHP Intl Class Datetime Clock Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Intl Class Datetime Clock Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='PHP Intl Class Datetime Defaults Tutorial' href='#phpicddt'>PHP Intl Class Datetime Defaults Tutorial<\/a>&#8216;s PHP web application involves &#8230;<\/p>\n<ul>\n<li>timezones &#8230; and, for us, whenever that happens, our eyes light up with &#8220;possibility&#8221; because &#8230;<\/li>\n<li>&#8220;where&#8221; meets &#8220;when&#8221; &#8230; when you have timezones involved &#8230; and to our mind &#8230;<\/li>\n<li>&#8220;where&#8221; and &#8220;when&#8221; are the best catered for &#8220;adverbs&#8221; in the I.T. wooooorrrrlllldddd<\/li>\n<\/ul>\n<p>Invariably, too, the data is &#8220;full of possibility&#8221; regarding simple ideas of &#8220;internationalization&#8221; that are easy to deploy, such as &#8230;<\/p>\n<ul>\n<li>emoji flags<\/li>\n<li><a target=\"_blank\" href='\/\/wikipedia.org' rel=\"noopener\">Wikipedia<\/a> lookups in the form of tabulated lists<\/li>\n<\/ul>\n<p>And so, though our last web application is not totally disengageable from our English bias, we can help its &#8220;Internationalization Credentials&#8221; today, via &#8230;<\/p>\n<ul>\n<li>emoji flag code &#8230;<br \/>\n<table>\n<tr>\n<th>PHP<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php<br \/>\n<code><br \/>\nfunction orflag($incc) {<br \/>\n    $uretv='';<br \/>\n    $lri=[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\", \"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];<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\"];<br \/>\n    for ($jjm=0; $jjm&lt;strlen($incc); $jjm++) {<br \/>\n      for ($jm=0; $jm&lt;sizeof($lri); $jm++) {<br \/>\n       if (strtoupper(substr(substr($incc,$jjm),0,1)) == $lri[$jm]) {<br \/>\n         $uretv.='&#' . $dri[$jm] . \";\";<br \/>\n       }<br \/>\n      }<br \/>\n    }<br \/>\n    return $uretv;<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;\n<\/td>\n<\/tr>\n<tr>\n<th>Javascript<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n    function jorflag(thiscc) {<br \/>\n  var lri='ABCDEFGHIJKLMNOPQRSTUVWXYZ';<br \/>\n  var 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'];<br \/>\n      var ccsuff='', ccchar=' ', cde='';<br \/>\n      for (var iccsuff=0; iccsuff&lt;thiscc.length; iccsuff++) {<br \/>\n        ccchar=thiscc.substring(iccsuff, eval(1 + eval('' + iccsuff))).toUpperCase();<br \/>\n        ccsuff+=String.fromCodePoint(dri[eval('' + lri.indexOf(ccchar))]); \/\/'&#' + dri[eval('' + lri.indexOf(ccchar))] + ';';<br \/>\n        cde='.';<br \/>\n      }<br \/>\n      return ccsuff;<br \/>\n    }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;\n<\/td>\n<\/tr>\n<\/table>\n<\/li>\n<li>new clock functionality (using an Internationalization emoji usage regarding an SVG based button background image) and known timezone reasons to tabulate &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n$tabp='';<br \/>\n$tabs='';<br \/>\nif (isset($_GET['timezone'])) {<br \/>\n $tabp='&lt;table style=width:100%;&gt;&lt;tr&gt;&lt;td style=vertical-align:top;&gt;';<br \/>\n $tabs='&lt;\/td&gt;&lt;td style=vertical-align:top;width:50%;&gt;&lt;iframe src=\"\/HTMLCSS\/colour_wheel.html?mode=' . $_GET['timezone'] . '\" style=width:100%;height:800px;&gt;&lt;\/iframe&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;';<br \/>\n} else if (isset($_POST['timezone'])) {<br \/>\n $tabp='&lt;table style=width:100%;&gt;&lt;tr&gt;&lt;td style=vertical-align:top;&gt;';<br \/>\n $tabs='&lt;\/td&gt;&lt;td style=vertical-align:top;width:50%;&gt;&lt;iframe src=\"\/HTMLCSS\/colour_wheel.html?mode=' . $_POST['timezone'] . '\" style=width:100%;height:800px;&gt;&lt;\/iframe&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;';<br \/>\n}<br \/>\n$revealp='';<br \/>\n$reveals='';<br \/>\n$clockcss='';<br \/>\n$clocksvg=\"data:image\/svg+xml;utf8,&lt;svg xmlns='http:\/\/www.w3.org\/2000\/svg' width='24' height='24' viewport='0 0 100 100' style='font-family:Verdana;font-size:10px;'&gt;&lt;text y='50%'&gt;\\\\0023f0&lt;\/text&gt;&lt;\/svg&gt;\";<br \/>\n<br \/>\nif (isset($_GET['clock']) || isset($_POST['clock'])) {<br \/>\n  $revealp='&lt;details title=\"Form you can use to display different time or different clock\"&gt;&lt;summary title=\"Form you can use to display different time or different clock\"&gt;&lt;\/summary&gt;' . $tabp;<br \/>\n  $reveals=$tabs . '&lt;\/details&gt;';<br \/>\n  $clockcss=\"\\n #pdfmt { border-radius: 50px; } \\n\";<br \/>\n} else {<br \/>\n  $revealp=$tabp;<br \/>\n  $reveals=$tabs;<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;\n<\/li>\n<li>document.body onload emoji flag application (via Javascript) &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n   function onlit() {<br \/>\n             txils=parent.document.getElementById('tzsel').innerHTML.split(' value=\\\"' + thistz + '\\\"');<br \/>\n           if (eval('' + txils.length) &gt; 1) {<br \/>\n           isov=txils[1].split('&gt;')[0].split(',')[3];<br \/>\n           cnb='';<br \/>\n     if (ctynames.indexOf(\\\" value='\\\" + isov + \\\"'&gt;\\\") != -1) {<br \/>\n       cnb=' in ' + ctynames.split(\\\" value='\\\" + isov + \\\"'&gt;\\\")[1].split('&lt;')[0];<br \/>\n       document.getElementById('tzsel').title='Default is a Timezone in ' + ctynames.split(\\\" value='\\\" + isov + \\\"'&gt;\\\")[1].split('&lt;')[0];<br \/>\n       document.getElementById('myh1').innerHTML+=' for ' + (thistz + '\/').replace(thistz.split('\/')[0] + '\/', '').split('\/')[1].replace(\/\\_\/g,' ') + ' ' + (thistz + '\/').replace(thistz.split('\/')[0] + '\/', '').split('\/')[0].replace(\/\\_\/g,' ').trim().replace('Argentina','');<br \/>\n       document.getElementById('myh1').innerHTML+=cnb + ' ' + jorflag(isov);<br \/>\n     }<br \/>\n           }<br \/>\n   }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;\n<\/li>\n<li>clock button styling &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n$clockcss='';<br \/>\n$clocksvg=\"data:image\/svg+xml;utf8,&lt;svg xmlns='http:\/\/www.w3.org\/2000\/svg' width='24' height='24' viewport='0 0 100 100' style='font-family:Verdana;font-size:10px;'&gt;&lt;text y='50%'>\\\\0023f0<\/text>&lt;\/svg&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;style&gt;<br \/>\n \" . $clockcss . \"<br \/>\n input[type=\\\"text\\\"] { width: 250px; }<br \/>\n #clock { border-radius: 50px; color:pink; text-shadow:-1px 1px 1px yellow; background-image: url('\" . str_replace(\"'\",'\"',$clocksvg) . \"'); }<br \/>\n&lt;\/style&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<li>clock recursive style functionality via an iframe onload event paradigm (with function clockif below) &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  var documentURL=document.URL;<br \/>\n  var repcnt=0, cnb='', isov='', txils=[];<br \/>\n  var thistz=(location.search.split('timezone=')[1] ? (decodeURIComponent(location.search.split('timezone=')[1].split('&')[0]) + '') : '');<br \/>\n<br \/>\n  function clockif(iois) {<br \/>\n    if (iois.src.indexOf('About_Us.') == -1) {<br \/>\n    repcnt++;<br \/>\n    setTimeout(function(){ iois.src=iois.src.split('&rand=')[0] + '&rand=' + repcnt; }, 1000);<br \/>\n   var aconto = (iois.contentWindow || iois.contentDocument);<br \/>\n   if (aconto != null) {<br \/>\n   if (aconto.document) { aconto = aconto.document; }<br \/>\n   if (aconto.body != null) {<br \/>\n     if (aconto.getElementById('pdfmt') && parent.document.getElementById('pdfmt')) {<br \/>\n       parent.document.getElementById('pdfmt').innerHTML=aconto.getElementById('pdfmt').innerHTML;<br \/>\n       if (repcnt == 1) {<br \/>\n          parent.document.getElementById('pdfmt').style.border='5px dotted pink';<br \/>\n          parent.document.getElementById('pdfmt').style.padding='5 5 5 5';<br \/>\n          if (eval('' + txils.length) &gt; 1) {<br \/>\n          parent.document.getElementById('pdfmt').title='Timestamp for ' + documentURL.split('?')[1].split('&cl')[0].replace(\/\\&\/g,' ').replace(\/\\=\/g,' ').replace(\/\\%2F\/g,'\/').replace(\/\\%2f\/g,'\/') + txils[1].split('&gt;')[0] + cnb;<br \/>\n          } else {<br \/>\n          parent.document.getElementById('pdfmt').title='Timestamp for ' + documentURL.split('?')[1].split('&cl')[0].replace(\/\\&\/g,' ').replace(\/\\=\/g,' ').replace(\/\\%2F\/g,'\/').replace(\/\\%2f\/g,'\/');<br \/>\n          }<br \/>\n       }<br \/>\n     }<br \/>\n   }<br \/>\n    }<br \/>\n  }<br \/>\n  }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; called into play via document.body onload Javascript &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;body onload=\"onlit(); if (documentURL.indexOf('clock=') != -1) { setTimeout(function(){ document.getElementById('justincase').src=documentURL=documentURL.replace('clock=','cloNOWAYck=') + '&rand=' + repcnt; }, 1000); } \"&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; along with a new form submit button choice &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;input style=background-color:#f0f0f0; title=Clock type=submit id=clock name=clock value=Clock&gt;&lt;\/input&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;\n<\/li>\n<li>dropdown option (subelement) <font color=blue>emoji flag<\/font> title &#8230;<br \/>\n<table>\n<tr>\n<th>Locale<\/\/th><\/tr>\n<tr>\n<td>\n&lt;?php<br \/>\n<code><br \/>\n$locsel='';<br \/>\n$arrl=ResourceBundle::getLocales('');<br \/>\nfor ($df=0; $df&lt;sizeof($arrl); $df++) {<br \/>\n <font color=blue>$endih='';<br \/>\n $lastword=explode('_',$arrl[$df])[-1 + sizeof(explode('_',$arrl[$df]))];<br \/>\n $ends=explode(\"['\" . explode('-',explode('_',$arrl[$df])[0])[0] . '-', $lochelper);<br \/>\n if (sizeof($ends) &gt; 1) {<br \/>\n   $endih.=' ' . explode(\"'\", explode(\"['\", $ends[0])[-1 + sizeof(explode(\"['\", $ends[0]))])[0];<br \/>\n }<br \/>\n if (strpos($lochelpertwo, '&gt;' . explode('-',explode('_',$arrl[$df])[0])[0] . '&lt;\/a&gt;') !== false) {<br \/>\n   \/\/echo \"yes \" . explode('-',explode('_',$arrl[$df])[0])[0] . \"\\n&lt;br&gt;\";<br \/>\n   \/\/echo substr(explode('&gt;' . explode('-',explode('_',$arrl[$df])[0])[0] . '&lt;\/a&gt;', $lochelpertwo)[0], -250,250);<br \/>\n   $interim=explode('&lt;\/a&gt;', explode('&lt;tr', explode('&gt;' . explode('-',explode('_',$arrl[$df])[0])[0] . '&lt;\/a&gt;', $lochelpertwo)[0])[-1 + sizeof(explode('&lt;tr', explode('&gt;' . explode('-',explode('_',$arrl[$df])[0])[0] . '&lt;\/a&gt;', $lochelpertwo)[0]))])[0]; \/\/)[-1 + sizeof(explode('&gt;', explode('&lt;\/td&gt;', explode('&lt;tr', explode('&gt;' . explode('-',explode('_',$arrl[$df])[0])[0] . '&lt;\/a&gt;', $lochelpertwo)[0];<br \/>\n   \/\/exit;<br \/>\n   $aintm=explode('&gt;', $interim)[-1 + sizeof(explode('&gt;', $interim))];<br \/>\n   if (strpos($endih, ' ' . $aintm) === false) {<br \/>\n   if ($endih != '') {<br \/>\n   $endih.=' (' . $aintm . ')';<br \/>\n   } else {<br \/>\n   $endih.=' ' . $aintm;<br \/>\n   }<br \/>\n   }<br \/>\n }<br \/>\n if ($lastword == strtoupper($lastword) && strlen($lastword) == 2) {<br \/>\n   $endih.=' ' . orflag($lastword);<br \/>\n }<br \/>\n if ($endih != '') {<br \/>\n   $endih=\"\\t\" . $endih . '';<br \/>\n }<\/font><br \/>\n if (strpos(($arrl[$df] . '_'), '_') !== false) { \/\/} && strpos($arrl[$df], '0') === false) {<br \/>\n if ($locsel == '') {<br \/>\n   $locsel=\"&lt;select onchange=\\\"if (this.value.trim().length != 0) { document.getElementById('locale').value=tzdef(this.value);  }\\\" id=locsel&gt;&lt;option id=\\\"loptone\\\" value=''&gt;Optionally select a Locale below ...&lt;\/option&gt;&lt;\/select&gt;\";<br \/>\n }<br \/>\n $locsel=str_replace(\"&lt;\/select&gt;\", \"&lt;option value='\" . $arrl[$df] . \"' translate=\\\"no\\\"<font color=blue> title=\\\"\" . $endih . \"\\\"<\/font>&gt;\" . $arrl[$df] . \"&lt;\/option&gt;&lt;\/select&gt;\", $locsel);<br \/>\n }<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n<img src='\/i_eg_dd_locale_title.jpg'><\/img>\n<\/td>\n<\/tr>\n<tr>\n<th>TimeZone<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php<br \/>\n<code><br \/>\n$yourtzlist=\"&lt;select onchange=\\\"if (this.value.trim().length != 0) { document.getElementById('timezone').value=this.value;  }\\\" id=tzsel&gt;&lt;option id=\\\"toptone\\\" value=''&gt;Optionally select a TimeZone below ...&lt;\/option&gt;&lt;option value='Africa\/Abidjan' data-geo='5.31666,-4.03334,GMT,CI,+0'&gt;Africa\/Abidjan&lt;\/option&gt;&lt;option value='Africa\/Accra' data-geo='5.55,-0.21667,GMT,GH,+0'&gt;Africa\/Accra&lt;\/option&gt;&lt;option value='Africa\/Addis_Ababa' data-geo='9.03333,38.7,EAT,ET,+3'&gt;Africa\/Addis_Ababa&lt;\/option&gt;&lt;option value='Africa\/Algiers' data-geo='36.78333,3.05,CET,DZ,+1'&gt;Africa\/Algiers&lt;\/option&gt; ... blah ... blah ... blah ... &lt;\/select&gt;\";<br \/>\n<br \/>\n<font color=blue>$yls=explode(\" data-geo='\", $yourtzlist);<br \/>\nfor ($iy=(-1 + sizeof($yls)); $iy&gt;=1; $iy--) {<br \/>\n  if (sizeof(explode(',', $yls[$iy])) &gt; 3) {<br \/>\n  $icp=explode(',', $yls[$iy])[3];<br \/>\n  \/\/echo $icp;<br \/>\n  if ($icp == strtoupper($icp) && strlen($icp) == 2 && strpos($icp, '?') === false) {<br \/>\n  \/\/echo $icp . ' data-geo=\"' . $yls[$iy] . ' becomes ' . ' title=\"' . orflag($icp) . '\" data-geo=\"' . $yls[$iy];<br \/>\n  \/\/exit;<br \/>\n     $yourtzlist=str_replace(\" data-geo='\" . $yls[$iy], ' title=' . \"'\" . orflag($icp) . \"'\" . \" data-geo='\" . $yls[$iy], $yourtzlist);<br \/>\n  }<br \/>\n  }<br \/>\n}<\/font><br \/>\n<\/code><br \/>\n?&gt;<br \/>\n<img src='\/i_eg_dd_timezone_title.jpg'><\/img>\n<\/td>\n<\/tr>\n<\/table>\n<\/li>\n<\/ul>\n<p> &#8230; in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/i_eg.php--GETME\" rel=\"noopener\">a changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php--GETME\" rel=\"noopener\">&#8220;third draft&#8221;<\/a> PHP code offering here, as a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\">PHP web application<\/a>, you <a href='#myiflt'>can also try below<\/a>.<\/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-intl-class-datetime-clock-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Clock Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpicddt'>Previous relevant <a target=\"_blank\" title='PHP Intl Class Datetime Defaults Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-intl-class-datetime-defaults-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Defaults Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Intl Class Datetime Defaults Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/i_eg_more.jpg\" title=\"PHP Intl Class Datetime Defaults Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Intl Class Datetime Defaults Tutorial<\/p><\/div>\n<p>Onto the recent <a title='PHP Intl Class Datetime Tutorial' href='#phpicdt'>PHP Intl Class Datetime Tutorial<\/a> start to a PHP Current Datetime <a target=\"_blank\" href='https:\/\/www.php.net\/manual\/en\/book.intl.php' rel=\"noopener\">Intl<\/a> Using Internationalization web application we see a way forward improving &#8230;<\/p>\n<ul>\n<li>default Locale and TimeZone presented &#8230;<br \/>\n<table>\n<tr>\n<th>Locale<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php<br \/>\n<code><br \/>\n$defloc=Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);<br \/>\n<\/code><br \/>\n?&gt;\n<\/td>\n<\/tr>\n<tr>\n<th>Timezone<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php<br \/>\n<code><br \/>\n$deficc=explode('_', str_replace('_posix','',$defloc))[-1 + sizeof(explode('_', str_replace('_posix','',$defloc)))];<br \/>\n$yourtzlist=\"&lt;select onchange=\\\"if (this.value.trim().length != 0) { document.getElementById('timezone').value=this.value;  }\\\" id=tzsel&gt;&lt;option id=\\\"toptone\\\" value=''&gt;Optionally select a TimeZone below ...&lt;\/option&gt;&lt;option value='Africa\/Abidjan' data-geo='5.31666,-4.03334,GMT,CI,+0'&gt;Africa\/Abidjan&lt;\/option&gt;&lt;option value='Africa\/Accra' data-geo='5.55,-0.21667,GMT,GH,+0'&gt;Africa\/Accra&lt;\/option&gt;&lt;option value='Africa\/Addis_Ababa' data-geo='9.03333,38.7,EAT,ET,+3'&gt;Africa\/Addis_Ababa&lt;\/option&gt;&lt;option value='Africa\/Algiers' data-geo='36.78333,3.05,CET,DZ,+1'&gt;Africa\/Algiers&lt;\/option&gt; ... blah ... blah ... blah ... &lt;\/select&gt;\";<br \/>\n<br \/>\nif (strpos($yourtzlist, ',' . $deficc . ',') !== false) {<br \/>\n  $ourtz=explode('&lt;', explode('&gt;', explode(',' . $deficc . ',', $yourtzlist)[1])[1])[0];<br \/>\n} else {<br \/>\n  $ourtz=\"''\"; \/\/date.timezone; \/\/ ($_SERVER['TZ'] ?? (file_get_contents('\/etc\/timezone') ?: file_get_contents('\/etc\/localtime')))<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;\n<\/td>\n<\/tr>\n<\/table>\n<\/li>\n<li>add accompanying dropdown ways to select values from a list of what is available on Locale and TimeZone (as above) and Calendar &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n$calsel='';<br \/>\nif (1 == 1) {<br \/>\n$bundle=new ResourceBundle('','ICUDATA');<br \/>\n$cnames=[];<br \/>\n$calendars=$bundle-&gt;get('calendar');<br \/>\nforeach ($calendars as $n=&gt;$v) {<br \/>\n if ($calsel == '') {<br \/>\n   $calsel=\"&lt;select onchange=\\\"if (this.value.trim().length != 0) { document.getElementById('calendar').value=this.value;  }\\\" id=calsel&gt;&lt;option value=''&gt;Optionally select a Calendar system below ...&lt;\/option&gt;&lt;\/select&gt;\";<br \/>\n }<br \/>\n $calsel=str_replace(\"&lt;\/select&gt;\", \"&lt;option value='\" . $n . \"'&gt;\" . $n . \"&lt;\/option&gt;&lt;\/select&gt;\", $calsel);<br \/>\n $cnames[]=$n;<br \/>\n}<br \/>\n}<br \/>\n<br \/>\n$locsel='';<br \/>\n$arrl=ResourceBundle::getLocales('');<br \/>\nfor ($df=0; $df&lt;sizeof($arrl); $df++) {<br \/>\n if (strpos(($arrl[$df] . '_'), '_') !== false) { \/\/} && strpos($arrl[$df], '0') === false) {<br \/>\n if ($locsel == '') {<br \/>\n   $locsel=\"&lt;select onchange=\\\"if (this.value.trim().length != 0) { document.getElementById('locale').value=tzdef(this.value);  }\\\" id=locsel&gt;&lt;option id=\\\"loptone\\\" value=''&gt;Optionally select a Locale below ...&lt;\/option&gt;&lt;\/select&gt;\";<br \/>\n }<br \/>\n $locsel=str_replace(\"&lt;\/select&gt;\", \"&lt;option value='\" . $arrl[$df] . \"'&gt;\" . $arrl[$df] . \"&lt;\/option&gt;&lt;\/select&gt;\", $locsel);<br \/>\n }<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;\n<\/li>\n<li>change input type=text <font color=blue>placeholder<\/font> reflect any previously selected Locale and TimeZone and\/or Calendar &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\necho \"&lt;h1&gt;Show Current Time&lt;\/h1&gt;&lt;br&gt;&lt;h3&gt;RJM Programming - December, 2024&lt;\/h3&gt;&lt;br&gt;&lt;h4&gt;As per (white background textboxes optional) ...&lt;\/h4&gt;&lt;br&gt;&lt;br&gt;&lt;form method=GET onsubmit=\\\"if (document.getElementById('calendar').value.trim() != '') { document.getElementById('calendar').name='calendar';  } if (document.getElementById('locale').value.trim() == '' || document.getElementById('timezone').value.trim() == '') { return false; } return true;\\\" action=\\\".\/i_eg.php\\\"&gt;<br \/>\n&lt;br&gt;&lt;input type=text ondblclick=this.value=this.placeholder; style=background-color:yellow; id=locale name=locale placeholder=<font color=blue>\" . (isset($_GET['locale']) ? urldecode($_GET['locale']) : (isset($_POST['locale']) ? urldecode($_POST['locale']) : $defloc))  . \"<\/font> value='' title=Locale&gt;&lt;\/input&gt;&nbsp;\" . $locsel . \"<br \/>\n&lt;br&gt;&lt;input type=text ondblclick=this.value=this.placeholder; style=background-color:yellow; id=timezone name=timezone placeholder=<font color=blue>\" . (isset($_GET['timezone']) ? urldecode($_GET['timezone']) : (isset($_POST['timezone']) ? urldecode($_POST['timezone']) : $ourtz))  . \"<\/font> value='' title=TimeZone&gt;&lt;\/input&gt;&nbsp;\" . $yourtzlist . \"<br \/>\n&lt;br&gt;&lt;input type=text ondblclick=this.value=this.placeholder; style=background-color:white; id=calendar placeholder=<font color=blue>\" . (isset($_GET['calendar']) ? urldecode($_GET['calendar']) : (isset($_POST['calendar']) ? urldecode($_POST['calendar']) : \"gregorian\"))  . \"<\/font> value='' title=Calendar&gt;&lt;\/input&gt;&nbsp;\" . $calsel . \"<br \/>\n&lt;br&gt;&lt;br&gt;&lt;input style=background-color:lightgreen; type=submit value=Display&gt;&lt;\/input&gt;<br \/>\n&lt;\/form&gt;<br \/>\n\";<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;\n<\/li>\n<\/ul>\n<p> &#8230; and regarding Locale selections take the opportunity to gather up to the top of Locale and TimeZone dropdowns any options relevant to any Locale first selected &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;scri\" . \"pt type=text\/javascript&gt;<br \/>\n  var ctynames=\\\"\" . str_replace(\"\\n\",\"\",$ctynames) . \"\\\";<br \/>\n  var canmakenothing=false, firstloc='';<br \/>\n<br \/>\n  function tzdef(inloc) { \/\/ wrapper around Locale dropdown selected value<br \/>\n    var inicc=inloc.replace(\/\\-\/g,'_').split('_')[eval(-1 + inloc.replace(\/\\-\/g,'_').split('_').length)];<br \/>\n    var jnicc=inicc;<br \/>\n    var newtstuff='', newlstuff='', newts=0, newls=0, tvalis='';<br \/>\n    if (ctynames.indexOf(\\\" value='\\\" + inicc + \\\"'&gt;\\\") != -1) {<br \/>\n      jnicc=ctynames.split(\\\" value='\\\" + inicc + \\\"'&gt;\\\")[1].split('&lt;')[0];<br \/>\n    }<br \/>\n    if (document.getElementById('timezone').value == '' && inicc.trim() != '' && inicc == inicc.toUpperCase() && eval('' + inicc.length) == 2) {<br \/>\n      var tzoh=document.getElementById('tzsel').innerHTML;<br \/>\n      var aftertopt=document.getElementById('toptone').outerHTML;<br \/>\n      var tzloh=document.getElementById('locsel').innerHTML;<br \/>\n      var afterlopt=document.getElementById('loptone').outerHTML;<br \/>\n      var tzs=tzoh.split(',' + inicc + ',');<br \/>\n      if (eval('' + tzs.length) &gt; 1) {<br \/>\n        \/\/document.getElementById('timezone').value=tzs[1].split('&gt;')[1].split('&lt;')[0];<br \/>\n        tvalis=tzs[1].split('&gt;')[1].split('&lt;')[0];<br \/>\n        newtstuff+='&lt;option value=\\\"' + tvalis + '\\\"&gt;' + tvalis + '&lt;\/option&gt;';<br \/>\n        for (newts=1; newts&lt;eval('' + tzs.length); newts++) {<br \/>\n          if (tzs[newts].split('&gt;')[1].split('&lt;')[0] != tvalis) {<br \/>\n            newtstuff+='&lt;option value=\\\"' + tzs[newts].split('&gt;')[1].split('&lt;')[0] + '\\\"&gt;' + tzs[newts].split('&gt;')[1].split('&lt;')[0] + '&lt;\/option&gt;';<br \/>\n          }<br \/>\n        }<br \/>\n        tzs=tzloh.split('_' + inicc + '\\\"');<br \/>\n        if (eval('' + tzs.length) &gt; 1) {<br \/>\n        newlstuff+='&lt;option value=\\\"' + inloc + '\\\"&gt;' + inloc + '&lt;\/option&gt;';<br \/>\n        for (newls=1; newls&lt;eval('' + tzs.length); newls++) {<br \/>\n          if (tzs[newls].split('&gt;')[1].split('&lt;')[0] != inloc) {<br \/>\n            newlstuff+='&lt;option value=\\\"' + tzs[newls].split('&gt;')[1].split('&lt;')[0] + '\\\"&gt;' + tzs[newls].split('&gt;')[1].split('&lt;')[0] + '&lt;\/option&gt;';<br \/>\n          }<br \/>\n        }<br \/>\n        }<br \/>\n      }<br \/>\n      if (tzoh.indexOf(aftertopt) != -1 && newtstuff != '') {<br \/>\n        document.getElementById('tzsel').innerHTML=aftertopt.replace(' id=', ' data-id=').replace(' value=\\\"', ' value=\\\" ').replace(' a Time', ' ' + jnicc + ' Time') + newtstuff + aftertopt + tzoh.split(aftertopt)[1];<br \/>\n      }<br \/>\n      if (tzloh.indexOf(afterlopt) != -1 && newlstuff != '') {<br \/>\n        document.getElementById('locsel').innerHTML=afterlopt.replace(' id=', ' data-id=').replace(' value=\\\"', ' value=\\\" ').replace(' a Locale', ' ' + jnicc + ' Locale') + newlstuff + afterlopt + tzloh.split(afterlopt)[1];<br \/>\n      }<br \/>\n      if (tvalis != '') { document.getElementById('timezone').value=tvalis;  }<br \/>\n      document.getElementById('locsel').value=inloc;<br \/>\n      firstloc=inicc;<br \/>\n      canmakenothing=true;<br \/>\n    }<br \/>\n    if (document.getElementById('tzsel').value == ' ' && canmakenothing) {<br \/>\n       if (inicc != firstloc) {<br \/>\n         document.getElementById('tzsel').value='';<br \/>\n       }<br \/>\n    }<br \/>\n    return inloc.replace(\/\\-\/g,'_');<br \/>\n  }<br \/>\n&lt;\/scr\" . \"ipt&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; containing an ISO-3166 2 letter Country Code at it&#8217;s end, mentioning that country&#8217;s name in that first option of the TimeZone dropdown, so that some users will see a Country Name in the mix, adding to relatability, perhaps.<\/p>\n<p>We feel this considerably improves the User Experience using <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/i_eg.php-GETME\" rel=\"noopener\">a changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php-GETME\" rel=\"noopener\">&#8220;second draft&#8221;<\/a> PHP code offering here, as a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\">PHP web application<\/a>, you <a href='#myiflt'>can also try below<\/a>.<\/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-intl-class-datetime-defaults-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Defaults Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpicdt'>Previous relevant <a target=\"_blank\" title='PHP Intl Class Datetime Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-intl-class-datetime-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Intl Class Datetime Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/intl_class_revisit.gif\" title=\"PHP Intl Class Datetime Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Intl Class Datetime Tutorial<\/p><\/div>\n<p>We&#8217;re back revisiting the PHP <a target=\"_blank\" href='https:\/\/www.php.net\/manual\/en\/book.intl.php' rel=\"noopener\">intl<\/a> <font size=1>&#8220;Internationalization&#8221;<\/font> class mentioned in &#8220;the AlmaLinux install feeling&#8221; <a title='PHP Mbstring Multibyte String and Intl Class Tutorial' href='#phpmmsict'>PHP Mbstring Multibyte String and Intl Class Tutorial<\/a> &#8230;<\/p>\n<ul>\n<li>now, that on AlmaLinux, it works for us &#8230; and &#8230;<\/li>\n<li>with a revisit of <a target=\"_blank\" title='intl_currency.html' href='https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/intl_currency.html' rel=\"noopener\">intl_currency.html<\/a> <font size=1>(featuring a <a target=\"_blank\" title='intl_currency.php' href='https:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/intl_currency.php-GETME' rel=\"noopener\">&#8220;tweaked for AlmaLinux&#8221;<\/a> <a target=\"_blank\" title='intl_currency.php' href='https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/intl_currency.php-GETME' rel=\"noopener\">intl_currency.php<\/a>)<\/font> seeing the intl clientside Javascript talents for Internationalization, in action<\/li>\n<\/ul>\n<p>Reading a bit, we cottoned onto three data items being central to Datetime PHP <a target=\"_blank\" href='https:\/\/www.php.net\/manual\/en\/book.intl.php' rel=\"noopener\">intl<\/a> usage being &#8230;<\/p>\n<ol>\n<li>locale<\/li>\n<li>timezone<\/li>\n<li>calendar <font size=1>&#8230; optional<\/font><\/li>\n<\/ol>\n<p> &#8230; and, so, we&#8217;re starting our &#8220;learning curve&#8221; (we got great help from <a target=\"_blank\" href='https:\/\/stackoverflow.com\/questions\/44693939\/incorrect-hijri-date-in-php-intl' title='Excellent advice, thanks' rel=\"noopener\">this excellent website<\/a> developing &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\nif (isset($_GET['locale']) && isset($_GET['timezone']) && isset($_GET['calendar'])) {<br \/>\n $DateTime = new DateTime();<br \/>\n $IntlDateFormatter = new IntlDateFormatter(<br \/>\n                    urldecode($_GET['locale']) . '@calendar=' . urldecode($_GET['calendar']),<br \/>\n                    IntlDateFormatter::FULL,<br \/>\n                    IntlDateFormatter::FULL,<br \/>\n                    urldecode($_GET['timezone']),<br \/>\n                    IntlDateFormatter::TRADITIONAL);<br \/>\n<br \/>\n echo '&lt;p&gt;' . $IntlDateFormatter-&gt;format($DateTime) . '&lt;\/p&gt;&lt;br&gt;&lt;br&gt;';<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230;) in today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php_GETME\" rel=\"noopener\">&#8220;first draft&#8221;<\/a> &#8220;proof of concept&#8221; offering here, as a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" rel=\"noopener\">PHP web application<\/a>, you can also try below &#8230;<\/p>\n<p><iframe id=myiflt src=\"http:\/\/www.rjmprogramming.com.au\/i_eg.php\" style=\"width:90%;height:800px;\"><\/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-intl-class-datetime-tutorial\/' rel=\"noopener\">PHP Intl Class Datetime Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpmmsict'>Previous relevant <a target=\"_blank\" title='PHP Mbstring Multibyte String and Intl Class Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-mbstring-multibyte-string-and-intl-class-tutorial\/' rel=\"noopener\">PHP Mbstring Multibyte String and Intl Class Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_test.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Mbstring Multibyte String and Intl Class Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_test_again.jpg\" title=\"PHP Mbstring Multibyte String and Intl Class Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Mbstring Multibyte String and Intl Class Tutorial<\/p><\/div>\n<p>We&#8217;re revisiting the <a title='PHP Mbstring Multibyte String Primer Tutorial' href='#phpmmspt'>PHP Mbstring Multibyte String Primer Tutorial<\/a> of the past to see where we stand now with PHP 8 and &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" href='http:\/\/php.net\/manual\/en\/book.mbstring.php' title='Multibyte String Information' rel=\"noopener\">mbstring<\/a> &#8220;Multibyte String&#8221; extension &#8230; and &#8230;<\/li>\n<li><a target=\"_blank\" href='https:\/\/www.php.net\/manual\/en\/book.intl.php' rel=\"noopener\">intl<\/a> &#8220;Internationalization Functions&#8221; extension<\/li>\n<\/ul>\n<p> &#8230; and discovered that we can happily now have a chance incorporating these functionalities into PHP serverside logic into the future.  We tested this with <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_test.php-GETME\" title='Click picture' rel=\"noopener\">a tweaked<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_test.php-GETME\" title='Click picture' rel=\"noopener\">mbstring_test.php<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_test.php\" title='Click picture' rel=\"noopener\">&#8220;old way&#8221; live run<\/a> and <a target=\"_blank\" href=\"http:\/\/65.254.95.247\/PHP\/mbstring_test.php\" title='Click picture' rel=\"noopener\">&#8220;new way&#8221; live run<\/a> via the writing of a couple of &#8220;proof of concepts&#8221; &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" href='http:\/\/php.net\/manual\/en\/book.mbstring.php' title='Multibyte String Information' rel=\"noopener\">mbstring<\/a> &#8220;Multibyte String&#8221; extension usage with <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/mbstring_test.php_GETME\" title='Click picture' rel=\"noopener\">&#8220;proof of concept&#8221;<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/mbstring_test.php\" title='Click picture' rel=\"noopener\">&#8220;old way&#8221; live run<\/a> and <a target=\"_blank\" href=\"http:\/\/65.254.95.247\/mbstring_test.php\" title='Click picture' rel=\"noopener\">&#8220;new way&#8221; live run<\/a><\/li>\n<li><a target=\"_blank\" href='https:\/\/www.php.net\/manual\/en\/book.intl.php' rel=\"noopener\">intl<\/a> &#8220;Internationalization Functions&#8221; usage with  <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/intl_basics.php_GETME\" title='Click picture' rel=\"noopener\">&#8220;proof of concept&#8221;<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/intl_basics.php\" title='Click picture' rel=\"noopener\">&#8220;old way&#8221; live run<\/a> and <a target=\"_blank\" href=\"http:\/\/65.254.95.247\/intl_basics.php\" title='Click picture' rel=\"noopener\">&#8220;new way&#8221; live run<\/a><\/li>\n<\/ul>\n<p><img src='http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_intl.gif'><\/img><\/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-mbstring-multibyte-string-and-intl-class-tutorial\/' rel=\"noopener\">PHP Mbstring Multibyte String and Intl Class Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpmmspt'>Previous relevant <a target=\"_blank\" title='PHP Mbstring Multibyte String Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-mbstring-multibyte-string-primer-tutorial\/' rel=\"noopener\">PHP Mbstring Multibyte String 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\/PHP\/mbstring_test.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Mbstring Multibyte String Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_primer.jpg\" title=\"PHP Mbstring Multibyte String Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Mbstring Multibyte String Primer Tutorial<\/p><\/div>\n<p>Our (Mac OS X laptop) local <a target=\"_blank\" href='https:\/\/www.mamp.info\/' title='MAMP Apache\/PHP\/MySql web server landing page' rel=\"noopener\">MAMP<\/a> web server is an Apache\/PHP\/MySql web server.  In this environment you can find out a lot with some PHP code as per &#8230;<\/p>\n<p><code>&lt;?php <a target=\"_blank\" href='http:\/\/php.net\/manual\/en\/function.phpinfo.php' title='PHP phpinfo() method information' rel=\"noopener\">phpinfo();<\/a> ?&gt;<\/code><\/p>\n<p> &#8230; and if, in doing this, you find a reference to the <a target=\"_blank\" href='http:\/\/php.net\/manual\/en\/book.mbstring.php' title='Multibyte String Information' rel=\"noopener\">&#8220;mbstring&#8221;<\/a> Multibyte String Information functionality existing, you are a lucky candidate to introduce some internationalization code into your PHP code, for those occasions where the destination language uses a <a target=\"_blank\" title='UTF-8' href='https:\/\/en.wikipedia.org\/wiki\/UTF-8' rel=\"noopener\">UTF-8<\/a> character set where individual characters can not be described by the ascii character set from decimal 0 to decimal 255.   In other words, it takes more than one byte to describe each character of the language.  There are many languages like this, a few being the Chinese languages, Japanese and Korean.<\/p>\n<p>We followed a lot of the advice of the very useful <a target=\"_blank\" title='PHP mb_split (and mb_str_split) information' href='http:\/\/php.net\/manual\/en\/function.mb-split.php' rel=\"noopener\">link<\/a> (thanks) to create some PHP called &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" title='mbstring_test.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_test.php_GETME' rel=\"noopener\">mbstring_test.php<\/a><\/li>\n<\/ul>\n<p> &#8230; where we show what we always suspected but were too shy to ask, and didn&#8217;t flesh it out before &#8230; doh! &#8230; you can&#8217;t split a Chinese phrase&#8217;s characters into their individual characters and expect those characters individually translated bring you back to the sense of the Chinese phrase to start with.<\/p>\n<p>So we take the Chinese phrase \u706b\u8f66\u7968 (which translates into English as &#8220;Train tickets&#8221; &#8230; and we thank <a target=\"_blank\" title='Google Translate' href='http:\/\/transplate.google.com' rel=\"noopener\">Google Translate<\/a> for help with all this) and use PHP mbstring&#8217;s mb_str_split to properly split the Chinese into its constituent multibyte (UTF-8) characters (and along the way, show that PHP str_split messes up this same task, as you&#8217;d probably guess would happen), and then translate all these into English using Google Translate, as an intellectual exercise.<\/p>\n<p>If this <i><b>exercise<\/b><\/i> makes you &#8230;<\/p>\n<ul>\n<li>a) fall on the floor laughing<\/li>\n<li>b) hit a gong with a huge hammer<\/li>\n<li>c) cook up some deep fried dumplings<\/li>\n<li>d) put the left chopstick in the right ear and the right chopstick in the left ear <font size=0>(please ask for adult supervision)<\/font> &#8230; translation: do not do this<\/li>\n<li>e) while reading you sweep the cat under the rug <font size=0>(no animals were harmed in the making of this blog posting)<\/font><\/li>\n<\/ul>\n<p> &#8230; then we&#8217;re here to tell you that you need to take a <a target=\"_blank\" title='Take a Bex ... and ...' href='https:\/\/www.youtube.com\/watch?v=BF6ffbz70SY' rel=\"noopener\">Bex<\/a> and have a lie down.<\/p>\n<p>We are just showing in PHP that if the mbstring functionality is available to you, that the mbstring library of functionality can help with some Internationalization issues you may be grappling with and that this PHP code you could try via this <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mbstring_test.php\" title='Click picture' rel=\"noopener\">live run<\/a> link.<\/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='#d16000' onclick='var dv=document.getElementById(\"d16000\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=gimp\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d16000' 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='#d64382' onclick='var dv=document.getElementById(\"d64382\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/intl\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64382' 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='#d65821' onclick='var dv=document.getElementById(\"d65821\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/internationalization\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d65821' 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='#d65873' onclick='var dv=document.getElementById(\"d65873\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/dropdown\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d65873' 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='#d65883' onclick='var dv=document.getElementById(\"d65883\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/title\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d65883' 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='#d65898' onclick='var dv=document.getElementById(\"d65898\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/Google-Translate\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d65898' 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='#d65906' onclick='var dv=document.getElementById(\"d65906\"); 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='d65906' 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='#d65930' onclick='var dv=document.getElementById(\"d65930\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/currency\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d65930' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re back with the PHP intl &#8220;Internationalization&#8221; class, today, last talked about with the recent PHP Intl Class Datetime Keyboard Events Tutorial, this time discussing &#8230; Currency Internationalization &#8230; topics. Again, we found the Locale data item, as with Datetimes, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-intl-class-currency-primer-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":[5009,218,2392,2396,400,452,620,3172,4999,5000,2395,3211,5010,1562,2394,860,2911,1705,932,997,1986,1319],"class_list":["post-65930","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-amount","tag-code","tag-currency","tag-currency-code","tag-event","tag-form","tag-internationalization","tag-intl","tag-intl-class","tag-intl-object","tag-iso","tag-iso-4217","tag-keyborad","tag-locale","tag-number","tag-onblur","tag-oninput","tag-onkeydown","tag-php","tag-programming","tag-proof-of-concept","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/65930"}],"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=65930"}],"version-history":[{"count":5,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/65930\/revisions"}],"predecessor-version":[{"id":65936,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/65930\/revisions\/65936"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=65930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=65930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=65930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}