<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Blog &#187; PHP</title>
	<atom:link href="http://blog.thuongtin.net/category/lap-trinh/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thuongtin.net</link>
	<description>php, sql, autoit, javascript, c, html</description>
	<lastBuildDate>Tue, 15 Sep 2009 00:57:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Chỉnh time của server theo giờ VN</title>
		<link>http://blog.thuongtin.net/2009/09/15/chinh-time-cua-server-theo-gio-vn/</link>
		<comments>http://blog.thuongtin.net/2009/09/15/chinh-time-cua-server-theo-gio-vn/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 00:57:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.thuongtin.net/?p=459</guid>
		<description><![CDATA[Tình hình là đang làm 1 trang web và cần chỉnh lại thời gian của server theo giờ VN. Tìm trên mạng có nhiều cách là cộng trừ giờ, mà site đã viết rồi giờ edit 1 đống file thì rắc rối quá 
Tìm trên trang chủ của php thì thấy hàm này:

date_default_timezone_set ( &#34;Asia/Ho_Chi_Minh&#34; ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">Tình hình là đang làm 1 trang web và cần chỉnh lại thời gian của server theo giờ VN. Tìm trên mạng có nhiều cách là cộng trừ giờ, mà site đã viết rồi giờ edit 1 đống file thì rắc rối quá <img src='http://blog.thuongtin.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Tìm trên trang chủ của php thì thấy hàm này:</p>
<pre class="brush: php;">
date_default_timezone_set ( &quot;Asia/Ho_Chi_Minh&quot; );
</pre>
<p>Sử dụng:</p>
<pre class="brush: php;">

&lt;?php

date_default_timezone_set ( &quot;Asia/Ho_Chi_Minh&quot; );

echo date(&quot;Y-m-d H:i:s&quot;);

?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2009/04/23/auto-it-hide-process/" rel="bookmark">[Auto It] hide process</a></li><li><a href="http://blog.thuongtin.net/2009/04/23/autoit-autorun-va-lay-lan/" rel="bookmark">[AutoIt] Autorun và lây lan</a></li><li><a href="http://blog.thuongtin.net/2009/06/29/php-display-server-load/" rel="bookmark">[PHP] Display Server Load</a></li><li><a href="http://blog.thuongtin.net/2009/05/07/autoit-kiem-tra-nguoi-dung-viet-gi/" rel="bookmark">AutoIt - Kiểm tra người dùng viết gì.</a></li><li><a href="http://blog.thuongtin.net/2009/04/29/autoit-viet-phan-mem-spam-web/" rel="bookmark">[AutoIt] Viết phần mềm spam web</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=459&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2009/09/15/chinh-time-cua-server-theo-gio-vn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cách lấy link của megavideo.com</title>
		<link>http://blog.thuongtin.net/2009/08/10/cach-lay-link-cua-megavideo-com/</link>
		<comments>http://blog.thuongtin.net/2009/08/10/cach-lay-link-cua-megavideo-com/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 15:50:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Get links]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.thuongtin.net/?p=456</guid>
		<description><![CDATA[Lâu rồi không viết blog này, hix hix.
Nói chung là cái này đơn giản.
Ví dụ link là: http://www.megavideo.com/?v=5VSH1C08
Ta lấy nội dung file xml của video đó:
http://www.megavideo.com/xml/videolink.php?v=5VSH1C08
Nội dung của xml là:
&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;ROWS&#62;&#60;ROW url="" runtime="154" runtimehms="02:34" size="10810129" waitingtime="5000" k="" k1="18680" k2="11594" un="ae72b6243e82c6484903f038a4f90633" s="283" title="evil+bong+review" description="the+killer+dolls+reviewing+evil+bong%21+i+think+they+should+join+are+you+smarter+than+a+5th+grader%2C+now+thats+a+good+match%21" added="2009-08-06" username="fullmoononline" views="24145" comments="4" favorited="5" category="comedy" tags="evil++bong++charles++band++boobs++blood++gore++horror++comedy++funny++naked++strippers++smoke++weed++marijuana++kill" rating="100" embed="%3Cobject+width%3D%22640%22+height%3D%22468%22%3E%3Cparam+name%3D%22movie%22+value%3D%22http%3A%2F%2Fwww.megavideo.com%2Fv%2F5VSH1C0855e84c8defcf089dba5cefcc8e1b1c30%22%3E%3C%2Fparam%3E%3Cparam+name%3D%22allowFullScreen%22+value%3D%22true%22%3E%3C%2Fparam%3E%3Cembed+src%3D%22http%3A%2F%2Fwww.megavideo.com%2Fv%2F5VSH1C0855e84c8defcf089dba5cefcc8e1b1c30%22+type%3D%22application%2Fx-shockwave-flash%22+allowfullscreen%3D%22true%22+width%3D%22640%22+height%3D%22468%22%3E%3C%2Fembed%3E%3C%2Fobject%3E"  &#62;&#60;/ROW&#62;
&#60;/ROWS&#62;

Chú ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">Lâu rồi không viết blog này, hix hix.</p>
<p>Nói chung là cái này đơn giản.</p>
<p>Ví dụ link là: http://www.megavideo.com/?v=<span style="color: #ff00ff;">5VSH1C08</span></p>
<p>Ta lấy nội dung file xml của video đó:</p>
<p>http://www.megavideo.com/xml/videolink.php?v=<span style="color: #ff00ff;">5VSH1C08</span></p>
<p>Nội dung của xml là:</p>
<pre id="line1">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ROWS&gt;&lt;ROW url="" runtime="154" runtimehms="02:34" size="10810129" waitingtime="5000" k="" k1="<span style="color: #ff00ff;">18680</span>" k2="<span style="color: #ff00ff;">11594</span>" un="<span style="color: #ff00ff;">ae72b6243e82c6484903f038a4f90633</span>" s="<span style="color: #0000ff;">283</span>" title="evil+bong+review" description="the+killer+dolls+reviewing+evil+bong%21+i+think+they+should+join+are+you+smarter+than+a+5th+grader%2C+now+thats+a+good+match%21" added="2009-08-06" username="fullmoononline" views="24145" comments="4" favorited="5" category="comedy" tags="evil++bong++charles++band++boobs++blood++gore++horror++comedy++funny++naked++strippers++smoke++weed++marijuana++kill" rating="100" embed="%3Cobject+width%3D%22640%22+height%3D%22468%22%3E%3Cparam+name%3D%22movie%22+value%3D%22http%3A%2F%2Fwww.megavideo.com%2Fv%2F5VSH1C0855e84c8defcf089dba5cefcc8e1b1c30%22%3E%3C%2Fparam%3E%3Cparam+name%3D%22allowFullScreen%22+value%3D%22true%22%3E%3C%2Fparam%3E%3Cembed+src%3D%22http%3A%2F%2Fwww.megavideo.com%2Fv%2F5VSH1C0855e84c8defcf089dba5cefcc8e1b1c30%22+type%3D%22application%2Fx-shockwave-flash%22+allowfullscreen%3D%22true%22+width%3D%22640%22+height%3D%22468%22%3E%3C%2Fembed%3E%3C%2Fobject%3E"  &gt;&lt;/ROW&gt;
&lt;/ROWS&gt;
</pre>
<p>Chú ý k1, k2, un, và s ta sẽ có được link download, k1, k2, un sẽ thay đổi mỗi lần truy cập vào.</p>
<p>Ta sẽ giải mã để lấy được link.</p>
<p>Hàm giải mã:</p>
<pre class="brush: php;">

function mv_decrypt($un_hash, $key1, $key2)

{

$str_bin = &quot;&quot;;

// 1. Convert hexadecimal string to binary string

for($i = 0; $i &lt; 128; $i++){

$str_bin .= floor(hexdec($un_hash[floor($i/4)])/pow(2,(3-($i%4))))%2;

}

// 2. Generate switch and XOR keys

$key = Array();

for ($i = 0; $i &lt; 384; $i++){

$key1 = ($key1 * 11 + 77213) % 81371;

$key2 = ($key2 * 17 + 92717) % 192811;

$key[$i] = ($key1 + $key2) % 128;

}

// 3. Switch bits positions

for ($i = 256; $i &gt;= 0; $i--){

$temp = $str_bin[$key[$i]];

$str_bin[$key[$i]] = $str_bin[$i%128];

$str_bin[$i%128] = $temp;

}

// 4. XOR entire binary string

for ($i = 0; $i &lt; 128; $i++){

$str_bin[$i] = $str_bin[$i] ^ $key[$i+256] &amp; 1;

}

// 5. Convert binary string back to hexadecimal

$un_hash = &quot;&quot;;

for($i = 0; $i &lt; 32; $i++){

$un_hash .= dechex(bindec(substr($str_bin, $i*4, 4)));

}

// 6. Return counted string

return $un_hash;

}
</pre>
<p>Link trả về sẽ là:</p>
<p>$link = &#8216;http://www<span style="color: #0000ff;">283</span>.megavideo.com/files/&#8217; . mv_decrypt($u, $k1, $k2) . &#8216;/&#8217;;</p>
<p>Vấn đề ở đây là khi truy cập vào file xml, nó sẽ log ip và k1, k2, k3.</p>
<p>Khi truy cập vào url $link nó sẽ kiểm tra xem ip và giải mã u, k1, k2 xem có trùng không, nên chỉ máy nào truy cập vào file xml mới có thể download phim tại $link, còn máy khác thì không thể.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/09/12/grab-link-megaroticcom/" rel="bookmark">Grab link megarotic.com</a></li><li><a href="http://blog.thuongtin.net/2008/10/10/lay-link-nct-nhaccuatuicom/" rel="bookmark">Lấy link NCT (nhaccuatui.com)</a></li><li><a href="http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/" rel="bookmark">8 mẫu Regular Expressions hữu ích</a></li><li><a href="http://blog.thuongtin.net/2008/10/10/chong-view-link-tu-cac-site-xai-xtre/" rel="bookmark">Chống view link từ các site xài xtre</a></li><li><a href="http://blog.thuongtin.net/2009/04/21/14-loi-khuyen-cua-ong-iec-haramis/" rel="bookmark">14 lời khuyên của ông I.E.C. Haramis</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=456&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2009/08/10/cach-lay-link-cua-megavideo-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Display Server Load</title>
		<link>http://blog.thuongtin.net/2009/06/29/php-display-server-load/</link>
		<comments>http://blog.thuongtin.net/2009/06/29/php-display-server-load/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 10:54:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.thuongtin.net/?p=437</guid>
		<description><![CDATA[

&#60;?php function get_server_load($windows = false) {
 $os = strtolower(PHP_OS);
 if(strpos($os, &#34;win&#34;) === false) {
 if(file_exists(&#34;/proc/loadavg&#34;)) {
 $load = file_get_contents(&#34;/proc/loadavg&#34;);
 $load = explode(' ', $load);
 return $load[0];
 } 

 elseif(function_exists(&#34;shell_exec&#34;)) {
 $load = explode(' ', `uptime`);        return $load[count($load)-1];
 } else {
 return false;
 }
 } elseif($windows) {
 if(class_exists(&#34;COM&#34;)) {
 ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">
<pre class="brush: php;">
&lt;?php function get_server_load($windows = false) {
 $os = strtolower(PHP_OS);
 if(strpos($os, &quot;win&quot;) === false) {
 if(file_exists(&quot;/proc/loadavg&quot;)) {
 $load = file_get_contents(&quot;/proc/loadavg&quot;);
 $load = explode(' ', $load);
 return $load[0];
 } 

 elseif(function_exists(&quot;shell_exec&quot;)) {
 $load = explode(' ', `uptime`);        return $load[count($load)-1];
 } else {
 return false;
 }
 } elseif($windows) {
 if(class_exists(&quot;COM&quot;)) {
 $wmi = new COM(&quot;WinMgmts:\\\\.&quot;);
 $cpus = $wmi-&gt;InstancesOf(&quot;Win32_Processor&quot;);
 $cpuload = 0;
 $i = 0;
 if(version_compare('4.50.0', PHP_VERSION) == 1) {
 // PHP 4
 while ($cpu = $cpus-&gt;Next()) {
 $cpuload += $cpu-&gt;LoadPercentage;
 $i++;
 }
 } else {
 // PHP 5
 foreach($cpus as $cpu) {
 $cpuload += $cpu-&gt;LoadPercentage;
 $i++;
 }
 }
 $cpuload = round($cpuload / $i, 2);
 return &quot;$cpuload%&quot;;
 } else {
 return false;
 }
 }
} ?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2009/04/23/auto-it-hide-process/" rel="bookmark">[Auto It] hide process</a></li><li><a href="http://blog.thuongtin.net/2009/04/23/autoit-autorun-va-lay-lan/" rel="bookmark">[AutoIt] Autorun và lây lan</a></li><li><a href="http://blog.thuongtin.net/2009/05/07/autoit-kiem-tra-nguoi-dung-viet-gi/" rel="bookmark">AutoIt - Kiểm tra người dùng viết gì.</a></li><li><a href="http://blog.thuongtin.net/2009/09/15/chinh-time-cua-server-theo-gio-vn/" rel="bookmark">Chỉnh time của server theo giờ VN</a></li><li><a href="http://blog.thuongtin.net/2009/04/29/autoit-viet-phan-mem-spam-web/" rel="bookmark">[AutoIt] Viết phần mềm spam web</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=437&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2009/06/29/php-display-server-load/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php &#8211; Chuyển từ IP sang Country [ ip 2 country ]</title>
		<link>http://blog.thuongtin.net/2009/05/26/php-chuyen-tu-ip-sang-country-ip-2-country/</link>
		<comments>http://blog.thuongtin.net/2009/05/26/php-chuyen-tu-ip-sang-country-ip-2-country/#comments</comments>
		<pubDate>Tue, 26 May 2009 12:38:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.thuongtin.net/?p=429</guid>
		<description><![CDATA[Ta dùng file countries.php:

&#60;?php
$anp_cd[&#34;AD&#34;]=array(&#34;Andorra&#34;, &#34;Europe&#34;, &#34;Andorra la Vella&#34;, &#34;Euro&#34;);
$anp_cd[&#34;AE&#34;]=array(&#34;United Arab Emirates&#34;, &#34;Middle East&#34;, &#34;Abu Dhabi&#34;, &#34;UAE Dirham&#34;);
$anp_cd[&#34;AF&#34;]=array(&#34;Afghanistan&#34;, &#34;Asia&#34;, &#34;Kabul&#34;, &#34;Afghani&#34;);
$anp_cd[&#34;AG&#34;]=array(&#34;Antigua and Barbuda&#34;, &#34;Central America and the Caribbean&#34;, &#34;Saint John's&#34;, &#34;East Caribbean Dollar&#34;);
$anp_cd[&#34;AI&#34;]=array(&#34;Anguilla&#34;, &#34;Central America and the Caribbean&#34;, &#34;The Valley&#34;, &#34;East Caribbean Dollar&#34;);
$anp_cd[&#34;AL&#34;]=array(&#34;Albania&#34;, &#34;Europe&#34;, &#34;Tirana&#34;, &#34;Lek&#34;);
$anp_cd[&#34;AM&#34;]=array(&#34;Armenia&#34;, &#34;Commonwealth of Independent States&#34;, &#34;Yerevan&#34;, &#34;Armenian Dram&#34;);
$anp_cd[&#34;AN&#34;]=array(&#34;Netherlands Antilles&#34;, &#34;Central America ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">Ta dùng file countries.php:</p>
<pre class="brush: php;">
&lt;?php
$anp_cd[&quot;AD&quot;]=array(&quot;Andorra&quot;, &quot;Europe&quot;, &quot;Andorra la Vella&quot;, &quot;Euro&quot;);
$anp_cd[&quot;AE&quot;]=array(&quot;United Arab Emirates&quot;, &quot;Middle East&quot;, &quot;Abu Dhabi&quot;, &quot;UAE Dirham&quot;);
$anp_cd[&quot;AF&quot;]=array(&quot;Afghanistan&quot;, &quot;Asia&quot;, &quot;Kabul&quot;, &quot;Afghani&quot;);
$anp_cd[&quot;AG&quot;]=array(&quot;Antigua and Barbuda&quot;, &quot;Central America and the Caribbean&quot;, &quot;Saint John's&quot;, &quot;East Caribbean Dollar&quot;);
$anp_cd[&quot;AI&quot;]=array(&quot;Anguilla&quot;, &quot;Central America and the Caribbean&quot;, &quot;The Valley&quot;, &quot;East Caribbean Dollar&quot;);
$anp_cd[&quot;AL&quot;]=array(&quot;Albania&quot;, &quot;Europe&quot;, &quot;Tirana&quot;, &quot;Lek&quot;);
$anp_cd[&quot;AM&quot;]=array(&quot;Armenia&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Yerevan&quot;, &quot;Armenian Dram&quot;);
$anp_cd[&quot;AN&quot;]=array(&quot;Netherlands Antilles&quot;, &quot;Central America and the Caribbean&quot;, &quot;Willemstad&quot;, &quot;Netherlands Antillean guilder&quot;);
$anp_cd[&quot;AO&quot;]=array(&quot;Angola&quot;, &quot;Africa&quot;, &quot;Luanda&quot;, &quot;Kwanza&quot;);
$anp_cd[&quot;AQ&quot;]=array(&quot;Antarctica&quot;, &quot;Antarctic Region&quot;, &quot;--&quot;, &quot;&quot;);
$anp_cd[&quot;AR&quot;]=array(&quot;Argentina&quot;, &quot;South America&quot;, &quot;Buenos Aires&quot;, &quot;Argentine Peso&quot;);
$anp_cd[&quot;AS&quot;]=array(&quot;American Samoa&quot;, &quot;Oceania&quot;, &quot;Pago Pago&quot;, &quot;US Dollar&quot;);
$anp_cd[&quot;AT&quot;]=array(&quot;Austria&quot;, &quot;Europe&quot;, &quot;Vienna&quot;, &quot;Euro&quot;);
$anp_cd[&quot;AU&quot;]=array(&quot;Australia&quot;, &quot;Oceania&quot;, &quot;Canberra&quot;, &quot;Australian dollar&quot;);
$anp_cd[&quot;AW&quot;]=array(&quot;Aruba&quot;, &quot;Central America and the Caribbean&quot;, &quot;Oranjestad&quot;, &quot;Aruban Guilder&quot;);
$anp_cd[&quot;AZ&quot;]=array(&quot;Azerbaijan&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Baku (Baki)&quot;, &quot;Azerbaijani Manat&quot;);
$anp_cd[&quot;BA&quot;]=array(&quot;Bosnia and Herzegovina&quot;,&quot;Bosnia and Herzegovina ,Europe&quot;, &quot;Sarajevo&quot;,&quot;Convertible Marka&quot;);
$anp_cd[&quot;BB&quot;]=array(&quot;Barbados&quot;, &quot;Central America and the Caribbean&quot;, &quot;Bridgetown&quot;, &quot;Barbados Dollar&quot;);
$anp_cd[&quot;BD&quot;]=array(&quot;Bangladesh&quot;, &quot;Asia&quot;, &quot;Dhaka&quot;, &quot;Taka&quot;);
$anp_cd[&quot;BE&quot;]=array(&quot;Belgium&quot;, &quot;Europe&quot;, &quot;Brussels&quot;, &quot;Euro&quot;);
$anp_cd[&quot;BF&quot;]=array(&quot;Burkina Faso&quot;, &quot;Africa&quot;, &quot;Ouagadougou&quot;, &quot;CFA Franc BCEAO&quot;);
$anp_cd[&quot;BG&quot;]=array(&quot;Bulgaria&quot;, &quot;Europe&quot;, &quot;Sofia&quot;, &quot;Lev&quot;);
$anp_cd[&quot;BH&quot;]=array(&quot;Bahrain&quot;, &quot;Middle East&quot;, &quot;Manama&quot;, &quot;Bahraini Dinar&quot;);
$anp_cd[&quot;BI&quot;]=array(&quot;Burundi&quot;, &quot;Africa&quot;, &quot;Bujumbura&quot;, &quot;Burundi Franc&quot;);
$anp_cd[&quot;BJ&quot;]=array(&quot;Benin&quot;, &quot;Africa&quot;, &quot;Porto-Novo&quot;, &quot;CFA Franc BCEAO&quot;);
$anp_cd[&quot;BM&quot;]=array(&quot;Bermuda&quot;, &quot;North America&quot;, &quot;Hamilton&quot;, &quot;Bermudian Dollar&quot;);
$anp_cd[&quot;BN&quot;]=array(&quot;Brunei Darussalam&quot;, &quot;Southeast Asia&quot;, &quot;Bandar Seri Begawan&quot;, &quot;Brunei Dollar&quot;);
$anp_cd[&quot;BO&quot;]=array(&quot;Bolivia&quot;, &quot;South America&quot;, &quot;La Paz /Sucre&quot;, &quot;Boliviano&quot;);
$anp_cd[&quot;BR&quot;]=array(&quot;Brazil&quot;, &quot;South America&quot;, &quot;Brasilia&quot;, &quot;Brazilian Real&quot;);
$anp_cd[&quot;BS&quot;]=array(&quot;The Bahamas&quot;, &quot;Central America and the Caribbean&quot;, &quot;Nassau&quot;, &quot;Bahamian Dollar&quot;);
$anp_cd[&quot;BT&quot;]=array(&quot;Bhutan&quot;, &quot;Asia&quot;, &quot;Thimphu&quot;, &quot;Ngultrum&quot;);
$anp_cd[&quot;BV&quot;]=array(&quot;Bouvet Island&quot;, &quot;Antarctic Region&quot;, &quot;--&quot;, &quot;Norwegian Krone&quot;);
$anp_cd[&quot;BW&quot;]=array(&quot;Botswana&quot;, &quot;Africa&quot;, &quot;Gaborone&quot;, &quot;Pula&quot;);
$anp_cd[&quot;BY&quot;]=array(&quot;Belarus&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Minsk&quot;, &quot;Belarussian Ruble&quot;);
$anp_cd[&quot;BZ&quot;]=array(&quot;Belize&quot;, &quot;Central America and the Caribbean&quot;, &quot;Belmopan&quot;, &quot;Belize Dollar&quot;);
$anp_cd[&quot;CA&quot;]=array(&quot;Canada&quot;, &quot;North America&quot;, &quot;Ottawa&quot;, &quot;Canadian Dollar&quot;);
$anp_cd[&quot;CC&quot;]=array(&quot;Cocos (Keeling) Islands&quot;, &quot;Southeast Asia&quot;, &quot;West Island&quot;, &quot;Australian Dollar&quot;);
$anp_cd[&quot;CD&quot;]=array(&quot;Congo, Democratic Republic of the&quot;, &quot;Africa&quot;, &quot;Kinshasa&quot;,&quot;Franc Congolais&quot;);
$anp_cd[&quot;CF&quot;]=array(&quot;Central African Republic&quot;, &quot;Africa&quot;, &quot;Bangui&quot;, &quot;CFA Franc BEAC&quot;);
$anp_cd[&quot;CG&quot;]=array(&quot;Congo, Republic of the&quot;,&quot;Africa&quot;, &quot;Brazzaville&quot;,&quot;CFA Franc BEAC&quot;);
$anp_cd[&quot;CH&quot;]=array(&quot;Switzerland&quot;, &quot;Europe&quot;, &quot;Bern&quot;, &quot;Swiss Franc&quot;);
$anp_cd[&quot;CI&quot;]=array(&quot;Cote d'Ivoire&quot;, &quot;Africa&quot;, &quot;Yamoussoukro&quot;, &quot;CFA Franc BCEAO&quot;);
$anp_cd[&quot;CK&quot;]=array(&quot;Cook Islands&quot;, &quot;Oceania&quot;, &quot;Avarua&quot;, &quot;New Zealand Dollar&quot;);
$anp_cd[&quot;CL&quot;]=array(&quot;Chile&quot;, &quot;South America&quot;, &quot;Santiago&quot;, &quot;Chilean Peso&quot;);
$anp_cd[&quot;CM&quot;]=array(&quot;Cameroon&quot;, &quot;Africa&quot;, &quot;Yaounde&quot;, &quot;CFA Franc BEAC&quot;);
$anp_cd[&quot;CN&quot;]=array(&quot;China&quot;, &quot;Asia&quot;, &quot;Beijing&quot;, &quot;Yuan Renminbi&quot;);
$anp_cd[&quot;CO&quot;]=array(&quot;Colombia&quot;, &quot;South America,Central America and the Caribbean&quot;,&quot;Bogota&quot;,&quot;Colombian Peso&quot;);
$anp_cd[&quot;CR&quot;]=array(&quot;Costa Rica&quot;, &quot;Central America and the Caribbean&quot;, &quot;San Jose&quot;, &quot;Costa Rican Colon&quot;);
$anp_cd[&quot;CU&quot;]=array(&quot;Cuba&quot;, &quot;Central America and the Caribbean&quot;, &quot;Havana&quot;, &quot;Cuban Peso&quot;);
$anp_cd[&quot;CV&quot;]=array(&quot;Cape Verde&quot;, &quot;World&quot;, &quot;Praia&quot;, &quot;Cape Verdean Escudo&quot;);
$anp_cd[&quot;CX&quot;]=array(&quot;Christmas Island&quot;, &quot;Southeast Asia&quot;, &quot;The Settlement&quot;, &quot;Australian Dollar&quot;);
$anp_cd[&quot;CY&quot;]=array(&quot;Cyprus&quot;, &quot;Middle East&quot;, &quot;Nicosia&quot;, &quot;Cyprus Pound&quot;);
$anp_cd[&quot;CZ&quot;]=array(&quot;Czech Republic&quot;, &quot;Europe&quot;, &quot;Prague&quot;, &quot;Czech Koruna&quot;);
$anp_cd[&quot;DE&quot;]=array(&quot;Germany&quot;, &quot;Europe&quot;, &quot;Berlin&quot;, &quot;Euro&quot;);
$anp_cd[&quot;DJ&quot;]=array(&quot;Djibouti&quot;, &quot;Africa&quot;, &quot;Djibouti&quot;, &quot;Djibouti Franc&quot;);
$anp_cd[&quot;DK&quot;]=array(&quot;Denmark&quot;, &quot;Europe&quot;, &quot;Copenhagen&quot;, &quot;Danish Krone&quot;);
$anp_cd[&quot;DM&quot;]=array(&quot;Dominica&quot;, &quot;Central America and the Caribbean&quot;, &quot;Roseau&quot;, &quot;East Caribbean Dollar&quot;);
$anp_cd[&quot;DO&quot;]=array(&quot;Dominican Republic&quot;, &quot;Central America and the Caribbean&quot;, &quot;Santo Domingo&quot;, &quot;Dominican Peso&quot;);
$anp_cd[&quot;DZ&quot;]=array(&quot;Algeria&quot;, &quot;Africa&quot;, &quot;Algiers&quot;, &quot;Algerian Dinar&quot;);
$anp_cd[&quot;EC&quot;]=array(&quot;Ecuador&quot;, &quot;South America&quot;, &quot;Quito&quot;, &quot;US dollar&quot;);
$anp_cd[&quot;EE&quot;]=array(&quot;Estonia&quot;, &quot;Europe&quot;, &quot;Tallinn&quot;, &quot;Kroon&quot;);
$anp_cd[&quot;EG&quot;]=array(&quot;Egypt&quot;, &quot;Africa&quot;, &quot;Cairo&quot;, &quot;Egyptian Pound&quot;);
$anp_cd[&quot;EH&quot;]=array(&quot;Western Sahara&quot;, &quot;Africa&quot;, &quot;--&quot;, &quot;Moroccan Dirham&quot;);
$anp_cd[&quot;ER&quot;]=array(&quot;Eritrea&quot;, &quot;Africa&quot;, &quot;Asmara&quot;, &quot;Nakfa&quot;);
$anp_cd[&quot;ES&quot;]=array(&quot;Spain&quot;, &quot;Europe&quot;, &quot;Madrid&quot;, &quot;Euro&quot;);
$anp_cd[&quot;ET&quot;]=array(&quot;Ethiopia&quot;, &quot;Africa&quot;, &quot;Addis Ababa&quot;, &quot;Ethiopian Birr&quot;);
$anp_cd[&quot;FI&quot;]=array(&quot;Finland&quot;, &quot;Europe&quot;, &quot;Helsinki&quot;, &quot;Euro&quot;);
$anp_cd[&quot;FJ&quot;]=array(&quot;Fiji&quot;, &quot;Oceania&quot;, &quot;Suva&quot;, &quot;Fijian Dollar&quot;);
$anp_cd[&quot;FK&quot;]=array(&quot;Falkland Islands (Islas Malvinas)&quot;, &quot;South America&quot;, &quot;Stanley&quot;, &quot;Falkland Islands Pound&quot;);
$anp_cd[&quot;FM&quot;]=array(&quot;Micronesia, Federated States of&quot;,&quot;Oceania&quot;,&quot;Palikir&quot;,&quot;US dollar&quot;);
$anp_cd[&quot;FO&quot;]=array(&quot;Faroe Islands&quot;, &quot;Europe&quot;, &quot;Torshavn&quot;, &quot;Danish Krone&quot;);
$anp_cd[&quot;FR&quot;]=array(&quot;France&quot;, &quot;Europe&quot;, &quot;Paris&quot;, &quot;Euro&quot;);
$anp_cd[&quot;FX&quot;]=array(&quot;France, Metropolitan&quot;, &quot;--&quot;, &quot;--&quot;, &quot;Euro&quot;);
$anp_cd[&quot;GA&quot;]=array(&quot;Gabon&quot;, &quot;Africa&quot;, &quot;Libreville&quot;, &quot;CFA Franc BEAC&quot;);
$anp_cd[&quot;GD&quot;]=array(&quot;Grenada&quot;, &quot;Central America and the Caribbean&quot;, &quot;Saint George's&quot;, &quot;East Caribbean Dollar&quot;);
$anp_cd[&quot;GE&quot;]=array(&quot;Georgia&quot;, &quot;Commonwealth of Independent States&quot;, &quot;T'bilisi&quot;, &quot;Lari&quot;);
$anp_cd[&quot;GF&quot;]=array(&quot;French Guiana&quot;, &quot;South America&quot;, &quot;Cayenne&quot;, &quot;Euro&quot;);
$anp_cd[&quot;GG&quot;]=array(&quot;Guernsey&quot;, &quot;Europe&quot;, &quot;Saint Peter Port&quot;, &quot;Pound Sterling&quot;);
$anp_cd[&quot;GH&quot;]=array(&quot;Ghana&quot;, &quot;Africa&quot;, &quot;Accra&quot;, &quot;Cedi&quot;);
$anp_cd[&quot;GI&quot;]=array(&quot;Gibraltar&quot;, &quot;Europe&quot;, &quot;Gibraltar&quot;, &quot;Gibraltar Pound&quot;);
$anp_cd[&quot;GL&quot;]=array(&quot;Greenland&quot;, &quot;Arctic Region&quot;, &quot;Nuuk&quot;, &quot;Danish Krone&quot;);
$anp_cd[&quot;GM&quot;]=array(&quot;The Gambia&quot;, &quot;Africa&quot;, &quot;Banjul&quot;, &quot;Dalasi&quot;);
$anp_cd[&quot;GN&quot;]=array(&quot;Guinea&quot;, &quot;Africa&quot;, &quot;Conakry&quot;, &quot;Guinean Franc&quot;);
$anp_cd[&quot;GP&quot;]=array(&quot;Guadeloupe&quot;, &quot;Central America and the Caribbean&quot;, &quot;Basse-Terre&quot;, &quot;Euro&quot;);
$anp_cd[&quot;GQ&quot;]=array(&quot;Equatorial Guinea&quot;, &quot;Africa&quot;, &quot;Malabo&quot;, &quot;CFA Franc BEAC&quot;);
$anp_cd[&quot;GR&quot;]=array(&quot;Greece&quot;, &quot;Europe&quot;, &quot;Athens&quot;, &quot;Euro&quot;);
$anp_cd[&quot;GS&quot;]=array(&quot;South Georgia and the South Sandwich Islands&quot;, &quot;Antarctic Region&quot;, &quot;--&quot;, &quot;Pound Sterling&quot;);
$anp_cd[&quot;GT&quot;]=array(&quot;Guatemala&quot;, &quot;Central America and the Caribbean&quot;, &quot;Guatemala&quot;, &quot;Quetzal&quot;);
$anp_cd[&quot;GU&quot;]=array(&quot;Guam&quot;, &quot;Oceania&quot;, &quot;Hagatna&quot;, &quot;US Dollar&quot;);
$anp_cd[&quot;GW&quot;]=array(&quot;Guinea-Bissau&quot;, &quot;Africa&quot;, &quot;Bissau&quot;, &quot;CFA Franc BCEAO&quot;);
$anp_cd[&quot;GY&quot;]=array(&quot;Guyana&quot;, &quot;South America&quot;, &quot;Georgetown&quot;, &quot;Guyana Dollar&quot;);
$anp_cd[&quot;HK&quot;]=array(&quot;Hong Kong (SAR)&quot;, &quot;Southeast Asia&quot;, &quot;Hong Kong&quot;, &quot;Hong Kong Dollar&quot;);
$anp_cd[&quot;HM&quot;]=array(&quot;Heard Island and McDonald Islands&quot;, &quot;Antarctic Region&quot;, &quot;--&quot;, &quot;Australian Dollar&quot;);
$anp_cd[&quot;HN&quot;]=array(&quot;Honduras&quot;, &quot;Central America and the Caribbean&quot;, &quot;Tegucigalpa&quot;, &quot;Lempira&quot;);
$anp_cd[&quot;HR&quot;]=array(&quot;Croatia&quot;, &quot;Europe&quot;, &quot;Zagreb&quot;, &quot;Kuna&quot;);
$anp_cd[&quot;HT&quot;]=array(&quot;Haiti&quot;, &quot;Central America and the Caribbean&quot;, &quot;Port-au-Prince&quot;, &quot;Gourde&quot;);
$anp_cd[&quot;HU&quot;]=array(&quot;Hungary&quot;, &quot;Europe&quot;, &quot;Budapest&quot;, &quot;Forint&quot;);
$anp_cd[&quot;ID&quot;]=array(&quot;Indonesia&quot;, &quot;Southeast Asia&quot;, &quot;Jakarta&quot;, &quot;Rupiah&quot;);
$anp_cd[&quot;IE&quot;]=array(&quot;Ireland&quot;, &quot;Europe&quot;, &quot;Dublin&quot;, &quot;Euro&quot;);
$anp_cd[&quot;IL&quot;]=array(&quot;Israel&quot;, &quot;Middle East&quot;, &quot;Jerusalem&quot;, &quot;New Israeli Sheqel&quot;);
$anp_cd[&quot;IM&quot;]=array(&quot;Man, Isle of&quot;,&quot;Europe&quot;,&quot;Douglas&quot;,&quot;Pound Sterling&quot;);
$anp_cd[&quot;IN&quot;]=array(&quot;India&quot;, &quot;Asia&quot;, &quot;New Delhi&quot;, &quot;Indian Rupee&quot;);
$anp_cd[&quot;IO&quot;]=array(&quot;British Indian Ocean Territory&quot;, &quot;World&quot;, &quot;--&quot;, &quot;US Dollar&quot;);
$anp_cd[&quot;IQ&quot;]=array(&quot;Iraq&quot;, &quot;Middle East&quot;, &quot;Baghdad&quot;, &quot;Iraqi Dinar&quot;);
$anp_cd[&quot;IR&quot;]=array(&quot;Iran&quot;, &quot;Middle East&quot;, &quot;Tehran&quot;, &quot;Iranian Rial&quot;);
$anp_cd[&quot;IS&quot;]=array(&quot;Iceland&quot;, &quot;Arctic Region&quot;, &quot;Reykjavik&quot;, &quot;Iceland Krona&quot;);
$anp_cd[&quot;IT&quot;]=array(&quot;Italy&quot;, &quot;Europe&quot;, &quot;Rome&quot;, &quot;Euro&quot;);
$anp_cd[&quot;JE&quot;]=array(&quot;Jersey&quot;, &quot;Europe&quot;, &quot;Saint Helier&quot;, &quot;Pound Sterling&quot;);
$anp_cd[&quot;JM&quot;]=array(&quot;Jamaica&quot;, &quot;Central America and the Caribbean&quot;, &quot;Kingston&quot;, &quot;Jamaican dollar&quot;);
$anp_cd[&quot;JO&quot;]=array(&quot;Jordan&quot;, &quot;Middle East&quot;, &quot;Amman&quot;, &quot;Jordanian Dinar&quot;);
$anp_cd[&quot;JP&quot;]=array(&quot;Japan&quot;, &quot;Asia&quot;, &quot;Tokyo&quot;, &quot;Yen&quot;);
$anp_cd[&quot;KE&quot;]=array(&quot;Kenya&quot;, &quot;Africa&quot;, &quot;Nairobi&quot;, &quot;Kenyan shilling&quot;);
$anp_cd[&quot;KG&quot;]=array(&quot;Kyrgyzstan&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Bishkek&quot;, &quot;Som&quot;);
$anp_cd[&quot;KH&quot;]=array(&quot;Cambodia&quot;, &quot;Southeast Asia&quot;, &quot;Phnom Penh&quot;, &quot;Riel&quot;);
$anp_cd[&quot;KI&quot;]=array(&quot;Kiribati&quot;, &quot;Oceania&quot;, &quot;Tarawa&quot;, &quot;Australian dollar&quot;);
$anp_cd[&quot;KM&quot;]=array(&quot;Comoros&quot;, &quot;Africa&quot;, &quot;Moroni&quot;, &quot;Comoro Franc&quot;);
$anp_cd[&quot;KN&quot;]=array(&quot;Saint Kitts and Nevis&quot;, &quot;Central America and the Caribbean&quot;, &quot;Basseterre&quot;, &quot;East Caribbean Dollar&quot;);
$anp_cd[&quot;KP&quot;]=array(&quot;Korea, North&quot;,&quot;Asia&quot;,&quot;P'yongyang&quot;,&quot;North Korean Won&quot;);
$anp_cd[&quot;KR&quot;]=array(&quot;Korea, South&quot;,&quot;Asia&quot;,&quot;Seoul&quot;,&quot;Won&quot;);
$anp_cd[&quot;KW&quot;]=array(&quot;Kuwait&quot;, &quot;Middle East&quot;, &quot;Kuwait&quot;, &quot;Kuwaiti Dinar&quot;);
$anp_cd[&quot;KY&quot;]=array(&quot;Cayman Islands&quot;, &quot;Central America and the Caribbean&quot;, &quot;George Town&quot;, &quot;Cayman Islands Dollar&quot;);
$anp_cd[&quot;KZ&quot;]=array(&quot;Kazakhstan&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Astana&quot;, &quot;Tenge&quot;);
$anp_cd[&quot;LA&quot;]=array(&quot;Laos&quot;, &quot;Southeast Asia&quot;, &quot;Vientiane&quot;, &quot;Kip&quot;);
$anp_cd[&quot;LB&quot;]=array(&quot;Lebanon&quot;, &quot;Middle East&quot;, &quot;Beirut&quot;, &quot;Lebanese Pound&quot;);
$anp_cd[&quot;LC&quot;]=array(&quot;Saint Lucia&quot;, &quot;Central America and the Caribbean&quot;, &quot;Castries&quot;, &quot;East Caribbean Dollar&quot;);
$anp_cd[&quot;LI&quot;]=array(&quot;Liechtenstein&quot;, &quot;Europe&quot;, &quot;Vaduz&quot;, &quot;Swiss Franc&quot;);
$anp_cd[&quot;LK&quot;]=array(&quot;Sri Lanka&quot;, &quot;Asia&quot;, &quot;Colombo&quot;, &quot;Sri Lanka Rupee&quot;);
$anp_cd[&quot;LR&quot;]=array(&quot;Liberia&quot;, &quot;Africa&quot;, &quot;Monrovia&quot;, &quot;Liberian Dollar&quot;);
$anp_cd[&quot;LS&quot;]=array(&quot;Lesotho&quot;, &quot;Africa&quot;, &quot;Maseru&quot;, &quot;Loti&quot;);
$anp_cd[&quot;LT&quot;]=array(&quot;Lithuania&quot;, &quot;Europe&quot;, &quot;Vilnius&quot;, &quot;Lithuanian Litas&quot;);
$anp_cd[&quot;LU&quot;]=array(&quot;Luxembourg&quot;, &quot;Europe&quot;, &quot;Luxembourg&quot;, &quot;Euro&quot;);
$anp_cd[&quot;LV&quot;]=array(&quot;Latvia&quot;, &quot;Europe&quot;, &quot;Riga&quot;, &quot;Latvian Lats&quot;);
$anp_cd[&quot;LY&quot;]=array(&quot;Libya&quot;, &quot;Africa&quot;, &quot;Tripoli&quot;, &quot;Libyan Dinar&quot;);
$anp_cd[&quot;MA&quot;]=array(&quot;Morocco&quot;, &quot;Africa&quot;, &quot;Rabat&quot;, &quot;Moroccan Dirham&quot;);
$anp_cd[&quot;MC&quot;]=array(&quot;Monaco&quot;, &quot;Europe&quot;, &quot;Monaco&quot;, &quot;Euro&quot;);
$anp_cd[&quot;MD&quot;]=array(&quot;Moldova&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Chisinau&quot;, &quot;Moldovan Leu&quot;);
$anp_cd[&quot;MG&quot;]=array(&quot;Madagascar&quot;, &quot;Africa&quot;, &quot;Antananarivo&quot;, &quot;Malagasy Franc&quot;);
$anp_cd[&quot;MH&quot;]=array(&quot;Marshall Islands&quot;, &quot;Oceania&quot;, &quot;Majuro&quot;, &quot;US dollar&quot;);
$anp_cd[&quot;MK&quot;]=array(&quot;Macedonia, The Former Yugoslav Republic of&quot;,&quot;Europe&quot;,&quot;Skopje&quot;,&quot;Denar&quot;);
$anp_cd[&quot;ML&quot;]=array(&quot;Mali&quot;, &quot;Africa&quot;, &quot;Bamako&quot;, &quot;CFA Franc BCEAO&quot;);
$anp_cd[&quot;MM&quot;]=array(&quot;Burma&quot;, &quot;Southeast Asia&quot;, &quot;Rangoon&quot;, &quot;kyat&quot;);
$anp_cd[&quot;MN&quot;]=array(&quot;Mongolia&quot;, &quot;Asia&quot;, &quot;Ulaanbaatar&quot;, &quot;Tugrik&quot;);
$anp_cd[&quot;MO&quot;]=array(&quot;Macao&quot;, &quot;Southeast Asia&quot;, &quot;Macao&quot;, &quot;Pataca&quot;);
$anp_cd[&quot;MP&quot;]=array(&quot;Northern Mariana Islands&quot;, &quot;Oceania&quot;, &quot;Saipan&quot;, &quot;US Dollar&quot;);
$anp_cd[&quot;MQ&quot;]=array(&quot;Martinique&quot;, &quot;Central America and the Caribbean&quot;, &quot;Fort-de-France&quot;, &quot;Euro&quot;);
$anp_cd[&quot;MR&quot;]=array(&quot;Mauritania&quot;, &quot;Africa&quot;, &quot;Nouakchott&quot;, &quot;Ouguiya&quot;);
$anp_cd[&quot;MS&quot;]=array(&quot;Montserrat&quot;, &quot;Central America and the Caribbean&quot;, &quot;Plymouth&quot;, &quot;East Caribbean Dollar&quot;);
$anp_cd[&quot;MT&quot;]=array(&quot;Malta&quot;, &quot;Europe&quot;, &quot;Valletta&quot;, &quot;Maltese Lira&quot;);
$anp_cd[&quot;MU&quot;]=array(&quot;Mauritius&quot;, &quot;World&quot;, &quot;Port Louis&quot;, &quot;Mauritius Rupee&quot;);
$anp_cd[&quot;MV&quot;]=array(&quot;Maldives&quot;, &quot;Asia&quot;, &quot;Male&quot;, &quot;Rufiyaa&quot;);
$anp_cd[&quot;MW&quot;]=array(&quot;Malawi&quot;, &quot;Africa&quot;, &quot;Lilongwe&quot;, &quot;Kwacha&quot;);
$anp_cd[&quot;MX&quot;]=array(&quot;Mexico&quot;, &quot;North America&quot;, &quot;Mexico&quot;, &quot;Mexican Peso&quot;);
$anp_cd[&quot;MY&quot;]=array(&quot;Malaysia&quot;, &quot;Southeast Asia&quot;, &quot;Kuala Lumpur&quot;, &quot;Malaysian Ringgit&quot;);
$anp_cd[&quot;MZ&quot;]=array(&quot;Mozambique&quot;, &quot;Africa&quot;, &quot;Maputo&quot;, &quot;Metical&quot;);
$anp_cd[&quot;NA&quot;]=array(&quot;Namibia&quot;, &quot;Africa&quot;, &quot;Windhoek&quot;, &quot;Namibian Dollar&quot;);
$anp_cd[&quot;NC&quot;]=array(&quot;New Caledonia&quot;, &quot;Oceania&quot;, &quot;Noumea&quot;, &quot;CFP Franc&quot;);
$anp_cd[&quot;NE&quot;]=array(&quot;Niger&quot;, &quot;Africa&quot;, &quot;Niamey&quot;, &quot;CFA Franc BCEAO&quot;);
$anp_cd[&quot;NF&quot;]=array(&quot;Norfolk Island&quot;, &quot;Oceania&quot;, &quot;Kingston&quot;, &quot;Australian Dollar&quot;);
$anp_cd[&quot;NG&quot;]=array(&quot;Nigeria&quot;, &quot;Africa&quot;, &quot;Abuja&quot;, &quot;Naira&quot;);
$anp_cd[&quot;NI&quot;]=array(&quot;Nicaragua&quot;, &quot;Central America and the Caribbean&quot;, &quot;Managua&quot;, &quot;Cordoba Oro&quot;);
$anp_cd[&quot;NL&quot;]=array(&quot;Netherlands&quot;, &quot;Europe&quot;, &quot;Amsterdam&quot;, &quot;Euro&quot;);
$anp_cd[&quot;NO&quot;]=array(&quot;Norway&quot;, &quot;Europe&quot;, &quot;Oslo&quot;, &quot;Norwegian Krone&quot;);
$anp_cd[&quot;NP&quot;]=array(&quot;Nepal&quot;, &quot;Asia&quot;, &quot;Kathmandu&quot;, &quot;Nepalese Rupee&quot;);
$anp_cd[&quot;NR&quot;]=array(&quot;Nauru&quot;, &quot;Oceania&quot;, &quot;--&quot;, &quot;Australian Dollar&quot;);
$anp_cd[&quot;NU&quot;]=array(&quot;Niue&quot;, &quot;Oceania&quot;, &quot;Alofi&quot;, &quot;New Zealand Dollar&quot;);
$anp_cd[&quot;NZ&quot;]=array(&quot;New Zealand&quot;, &quot;Oceania&quot;, &quot;Wellington&quot;, &quot;New Zealand Dollar&quot;);
$anp_cd[&quot;OM&quot;]=array(&quot;Oman&quot;, &quot;Middle East&quot;, &quot;Muscat&quot;, &quot;Rial Omani&quot;);
$anp_cd[&quot;PA&quot;]=array(&quot;Panama&quot;, &quot;Central America and the Caribbean&quot;, &quot;Panama&quot;, &quot;balboa&quot;);
$anp_cd[&quot;PE&quot;]=array(&quot;Peru&quot;, &quot;South America&quot;, &quot;Lima&quot;, &quot;Nuevo Sol&quot;);
$anp_cd[&quot;PF&quot;]=array(&quot;French Polynesia&quot;, &quot;Oceania&quot;, &quot;Papeete&quot;, &quot;CFP Franc&quot;);
$anp_cd[&quot;PG&quot;]=array(&quot;Papua New Guinea&quot;, &quot;Oceania&quot;, &quot;Port Moresby&quot;, &quot;Kina&quot;);
$anp_cd[&quot;PH&quot;]=array(&quot;Philippines&quot;, &quot;Southeast Asia&quot;, &quot;Manila&quot;, &quot;Philippine Peso&quot;);
$anp_cd[&quot;PK&quot;]=array(&quot;Pakistan&quot;, &quot;Asia&quot;, &quot;Islamabad&quot;, &quot;Pakistan Rupee&quot;);
$anp_cd[&quot;PL&quot;]=array(&quot;Poland&quot;, &quot;Europe&quot;, &quot;Warsaw&quot;, &quot;Zloty&quot;);
$anp_cd[&quot;PM&quot;]=array(&quot;Saint Pierre and Miquelon&quot;, &quot;North America&quot;, &quot;Saint-Pierre&quot;, &quot;Euro&quot;);
$anp_cd[&quot;PN&quot;]=array(&quot;Pitcairn Islands&quot;, &quot;Oceania&quot;, &quot;Adamstown&quot;, &quot;New Zealand Dollar&quot;);
$anp_cd[&quot;PR&quot;]=array(&quot;Puerto Rico&quot;, &quot;Central America and the Caribbean&quot;, &quot;San Juan&quot;, &quot;US dollar&quot;);
$anp_cd[&quot;PS&quot;]=array(&quot;Palestinian Territory, Occupied&quot;,&quot;--&quot;,&quot;&quot;,&quot;&quot;);
$anp_cd[&quot;PT&quot;]=array(&quot;Portugal&quot;, &quot;Europe&quot;, &quot;Lisbon&quot;, &quot;Euro&quot;);
$anp_cd[&quot;PW&quot;]=array(&quot;Palau&quot;, &quot;Oceania&quot;, &quot;Koror&quot;, &quot;US dollar&quot;);
$anp_cd[&quot;PY&quot;]=array(&quot;Paraguay&quot;, &quot;South America&quot;, &quot;Asuncion&quot;, &quot;Guarani&quot;);
$anp_cd[&quot;QA&quot;]=array(&quot;Qatar&quot;, &quot;Middle East&quot;, &quot;Doha&quot;, &quot;Qatari Rial&quot;);
$anp_cd[&quot;RE&quot;]=array(&quot;Réunion&quot;, &quot;World&quot;, &quot;Saint-Denis&quot;, &quot;Euro&quot;);
$anp_cd[&quot;RO&quot;]=array(&quot;Romania&quot;, &quot;Europe&quot;, &quot;Bucharest&quot;, &quot;Leu&quot;);
$anp_cd[&quot;RU&quot;]=array(&quot;Russia&quot;, &quot;Asia&quot;, &quot;Moscow&quot;, &quot;Russian Ruble&quot;);
$anp_cd[&quot;RW&quot;]=array(&quot;Rwanda&quot;, &quot;Africa&quot;, &quot;Kigali&quot;, &quot;Rwanda Franc&quot;);
$anp_cd[&quot;SA&quot;]=array(&quot;Saudi Arabia&quot;, &quot;Middle East&quot;, &quot;Riyadh&quot;, &quot;Saudi Riyal&quot;);
$anp_cd[&quot;SB&quot;]=array(&quot;Solomon Islands&quot;, &quot;Oceania&quot;, &quot;Honiara&quot;, &quot;Solomon Islands Dollar&quot;);
$anp_cd[&quot;SC&quot;]=array(&quot;Seychelles&quot;, &quot;Africa&quot;, &quot;Victoria&quot;, &quot;Seychelles Rupee&quot;);
$anp_cd[&quot;SD&quot;]=array(&quot;Sudan&quot;, &quot;Africa&quot;, &quot;Khartoum&quot;, &quot;Sudanese Dinar&quot;);
$anp_cd[&quot;SE&quot;]=array(&quot;Sweden&quot;, &quot;Europe&quot;, &quot;Stockholm&quot;, &quot;Swedish Krona&quot;);
$anp_cd[&quot;SG&quot;]=array(&quot;Singapore&quot;, &quot;Southeast Asia&quot;, &quot;Singapore&quot;, &quot;Singapore Dollar&quot;);
$anp_cd[&quot;SH&quot;]=array(&quot;Saint Helena&quot;, &quot;Africa&quot;, &quot;Jamestown&quot;, &quot;Saint Helenian Pound&quot;);
$anp_cd[&quot;SI&quot;]=array(&quot;Slovenia&quot;, &quot;Europe&quot;, &quot;Ljubljana&quot;, &quot;Tolar&quot;);
$anp_cd[&quot;SJ&quot;]=array(&quot;Svalbard&quot;, &quot;Arctic Region&quot;, &quot;Longyearbyen&quot;, &quot;Norwegian Krone&quot;);
$anp_cd[&quot;SK&quot;]=array(&quot;Slovakia&quot;, &quot;Europe&quot;, &quot;Bratislava&quot;, &quot;Slovak Koruna&quot;);
$anp_cd[&quot;SL&quot;]=array(&quot;Sierra Leone&quot;, &quot;Africa&quot;, &quot;Freetown&quot;, &quot;Leone&quot;);
$anp_cd[&quot;SM&quot;]=array(&quot;San Marino&quot;, &quot;Europe&quot;, &quot;San Marino&quot;, &quot;Euro&quot;);
$anp_cd[&quot;SN&quot;]=array(&quot;Senegal&quot;, &quot;Africa&quot;, &quot;Dakar&quot;, &quot;CFA Franc BCEAO&quot;);
$anp_cd[&quot;SO&quot;]=array(&quot;Somalia&quot;, &quot;Africa&quot;, &quot;Mogadishu&quot;, &quot;Somali Shilling&quot;);
$anp_cd[&quot;SR&quot;]=array(&quot;Suriname&quot;, &quot;South America&quot;, &quot;Paramaribo&quot;, &quot;Suriname Guilder&quot;);
$anp_cd[&quot;ST&quot;]=array(&quot;São Tom?and Príncipe&quot;, &quot;Africa&quot;, &quot;Sao Tome&quot;, &quot;Dobra&quot;);
$anp_cd[&quot;SV&quot;]=array(&quot;El Salvador&quot;, &quot;Central America and the Caribbean&quot;, &quot;San Salvador&quot;, &quot;El Salvador Colon&quot;);
$anp_cd[&quot;SY&quot;]=array(&quot;Syria&quot;, &quot;Middle East&quot;, &quot;Damascus&quot;, &quot;Syrian Pound&quot;);
$anp_cd[&quot;SZ&quot;]=array(&quot;Swaziland&quot;, &quot;Africa&quot;, &quot;Mbabane&quot;, &quot;Lilangeni&quot;);
$anp_cd[&quot;TC&quot;]=array(&quot;Turks and Caicos Islands&quot;, &quot;Central America and the Caribbean&quot;, &quot;Cockburn Town&quot;, &quot;US Dollar&quot;);
$anp_cd[&quot;TD&quot;]=array(&quot;Chad&quot;, &quot;Africa&quot;, &quot;N'Djamena&quot;, &quot;CFA Franc BEAC&quot;);
$anp_cd[&quot;TF&quot;]=array(&quot;French Southern and Antarctic Lands&quot;, &quot;Antarctic Region&quot;, &quot;--&quot;, &quot;Euro&quot;);
$anp_cd[&quot;TG&quot;]=array(&quot;Togo&quot;, &quot;Africa&quot;, &quot;Lome&quot;, &quot;CFA Franc BCEAO&quot;);
$anp_cd[&quot;TH&quot;]=array(&quot;Thailand&quot;, &quot;Southeast Asia&quot;, &quot;Bangkok&quot;, &quot;Baht&quot;);
$anp_cd[&quot;TJ&quot;]=array(&quot;Tajikistan&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Dushanbe&quot;, &quot;Somoni&quot;);
$anp_cd[&quot;TK&quot;]=array(&quot;Tokelau&quot;, &quot;Oceania&quot;, &quot;--&quot;, &quot;New Zealand Dollar&quot;);
$anp_cd[&quot;TM&quot;]=array(&quot;Turkmenistan&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Ashgabat&quot;, &quot;Manat&quot;);
$anp_cd[&quot;TN&quot;]=array(&quot;Tunisia&quot;, &quot;Africa&quot;, &quot;Tunis&quot;, &quot;Tunisian Dinar&quot;);
$anp_cd[&quot;TO&quot;]=array(&quot;Tonga&quot;, &quot;Oceania&quot;, &quot;Nuku'alofa&quot;, &quot;Pa'anga&quot;);
$anp_cd[&quot;TP&quot;]=array(&quot;East Timor&quot;, &quot;&quot;, &quot;--&quot;, &quot;Timor Escudo&quot;);
$anp_cd[&quot;TR&quot;]=array(&quot;Turkey&quot;, &quot;Middle East&quot;, &quot;Ankara&quot;, &quot;Turkish Lira&quot;);
$anp_cd[&quot;TT&quot;]=array(&quot;Trinidad and Tobago&quot;, &quot;Central America and the Caribbean&quot;, &quot;Port-of-Spain&quot;, &quot;Trinidad and Tobago Dollar&quot;);
$anp_cd[&quot;TV&quot;]=array(&quot;Tuvalu&quot;, &quot;Oceania&quot;, &quot;Funafuti&quot;, &quot;Australian Dollar&quot;);
$anp_cd[&quot;TW&quot;]=array(&quot;Taiwan&quot;, &quot;Southeast Asia&quot;, &quot;Taipei&quot;, &quot;New Taiwan Dollar&quot;);
$anp_cd[&quot;TZ&quot;]=array(&quot;Tanzania&quot;, &quot;Africa&quot;, &quot;Dar es Salaam&quot;, &quot;Tanzanian Shilling&quot;);
$anp_cd[&quot;UA&quot;]=array(&quot;Ukraine&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Kiev&quot;, &quot;Hryvnia&quot;);
$anp_cd[&quot;UG&quot;]=array(&quot;Uganda&quot;, &quot;Africa&quot;, &quot;Kampala&quot;, &quot;Uganda Shilling&quot;);
$anp_cd[&quot;UK&quot;]=array(&quot;United Kingdom&quot;, &quot;Europe&quot;, &quot;London&quot;, &quot;Pound Sterling&quot;);
$anp_cd[&quot;UM&quot;]=array(&quot;United States Minor Outlying Islands&quot;, &quot;&quot;, &quot;--&quot;, &quot;US Dollar&quot;);
$anp_cd[&quot;US&quot;]=array(&quot;United States&quot;,&quot;North America&quot;,&quot;Washington, DC&quot;,&quot;US Dollar&quot;);
$anp_cd[&quot;UY&quot;]=array(&quot;Uruguay&quot;, &quot;South America&quot;, &quot;Montevideo&quot;, &quot;Peso Uruguayo&quot;);
$anp_cd[&quot;UZ&quot;]=array(&quot;Uzbekistan&quot;, &quot;Commonwealth of Independent States&quot;, &quot;Tashkent&quot;, &quot;Uzbekistan Sum&quot;);
$anp_cd[&quot;VA&quot;]=array(&quot;Holy See (Vatican City)&quot;, &quot;Europe&quot;, &quot;Vatican City&quot;, &quot;Euro&quot;);
$anp_cd[&quot;VC&quot;]=array(&quot;Saint Vincent and the Grenadines&quot;, &quot;Central America and the Caribbean&quot;, &quot;Kingstown&quot;, &quot;East Caribbean Dollar&quot;);
$anp_cd[&quot;VE&quot;]=array(&quot;Venezuela&quot;,&quot;South America, Central America and the Caribbean&quot;,&quot;Caracas&quot;,&quot;Bolivar&quot;);
$anp_cd[&quot;VG&quot;]=array(&quot;British Virgin Islands&quot;, &quot;Central America and the Caribbean&quot;, &quot;Road Town&quot;, &quot;US dollar&quot;);
$anp_cd[&quot;VI&quot;]=array(&quot;Virgin Islands&quot;, &quot;Central America and the Caribbean&quot;, &quot;Charlotte Amalie&quot;, &quot;US Dollar&quot;);
$anp_cd[&quot;VN&quot;]=array(&quot;Vietnam&quot;, &quot;Southeast Asia&quot;, &quot;Hanoi&quot;, &quot;Dong&quot;);
$anp_cd[&quot;VU&quot;]=array(&quot;Vanuatu&quot;, &quot;Oceania&quot;, &quot;Port-Vila&quot;, &quot;Vatu&quot;);
$anp_cd[&quot;WF&quot;]=array(&quot;Wallis and Futuna&quot;, &quot;Oceania&quot;, &quot;Mata-Utu&quot;, &quot;CFP Franc&quot;);
$anp_cd[&quot;WS&quot;]=array(&quot;Samoa&quot;, &quot;Oceania&quot;, &quot;Apia&quot;, &quot;Tala&quot;);
$anp_cd[&quot;YE&quot;]=array(&quot;Yemen&quot;, &quot;Middle East&quot;, &quot;Sanaa&quot;, &quot;Yemeni Rial&quot;);
$anp_cd[&quot;YT&quot;]=array(&quot;Mayotte&quot;, &quot;Africa&quot;, &quot;Mamoutzou&quot;, &quot;Euro&quot;);
$anp_cd[&quot;YU&quot;]=array(&quot;Yugoslavia&quot;, &quot;Europe&quot;, &quot;Belgrade&quot;, &quot;Yugoslavian Dinar&quot;);
$anp_cd[&quot;ZA&quot;]=array(&quot;South Africa&quot;, &quot;Africa&quot;, &quot;Pretoria&quot;, &quot;Rand&quot;);
$anp_cd[&quot;ZM&quot;]=array(&quot;Zambia&quot;, &quot;Africa&quot;, &quot;Lusaka&quot;, &quot;Kwacha&quot;);
$anp_cd[&quot;ZW&quot;]=array(&quot;Zimbabwe&quot;, &quot;Africa&quot;, &quot;Harare&quot;, &quot;Zimbabwe Dollar&quot;);
$anp_cd[&quot;PX&quot;]=array(&quot;European Union&quot;, &quot;none&quot;, &quot;Europe&quot;, &quot;Euro&quot;);

?&gt;
</pre>
<p>Và: ip1.php</p>
<pre class="brush: php;">
&lt;?
include(&quot;countries.php&quot;);
function Dot2LongIP ($IPaddr)
{
if ($IPaddr == &quot;&quot;) {
return 0;
} else {
$ips = split (&quot;\.&quot;, &quot;$IPaddr&quot;);
return ($ips[3] + $ips[2] * 256 + $ips[1] * 65536 + $ips[0]
*16777216); }
}
function main()
{
print &lt;&lt;&lt;HTML
&lt;form method=post action=ip1.php?hth=h&gt;
&lt;input name= &quot;IPaddr&quot; value=127.0.0.1 type=text&gt;
&lt;input type=submit value=submit&gt;
&lt;/form&gt;
HTML;
}
switch($hth)
{
case &quot;h&quot;:
$ipnum= Dot2LongIP ($IPaddr);
$text=file(&quot;data.txt&quot;);
$ip=false;
for($i=0;$i&lt;count($text);$i++)
{
$t=explode(&quot;,&quot;,$text[$i]);
$t1=$t[0];
$t2=$t[1];
$t3=$t[4];
$t4=$t[2];

$t1=split(&quot;\&quot;&quot;,$t1);
$t2=split(&quot;\&quot;&quot;,$t2);
$t3=split(&quot;\&quot;&quot;,$t3);
$t4=split(&quot;\&quot;&quot;,$t4);
$t1=$t1[1];
$t2=$t2[1];
$t3=$t3[1];
$t4=$t4[1];

if($ipnum&gt;=$t1 &amp; $ipnum&lt;=$t2)
{
echo &quot;Country:&quot;.$t3;
echo &quot;:
&lt;img width=40 height=30 src=flags/&quot;.strtolower($t4).&quot;.gif&gt;&quot;;
$dl=$anp_cd[$t4];
echo &quot;
Region:&quot;.$dl[1];
echo &quot;
Country Capital:&quot;.$dl[2];
echo &quot;
Currency:&quot;.$dl[3];

$ip=true;
break;
}
}
echo ($ip==false)?&quot;No Country&quot;:&quot;&quot;;
break;
default:
main();
break;
}
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2009/04/23/auto-it-hide-process/" rel="bookmark">[Auto It] hide process</a></li><li><a href="http://blog.thuongtin.net/2009/04/23/autoit-autorun-va-lay-lan/" rel="bookmark">[AutoIt] Autorun và lây lan</a></li><li><a href="http://blog.thuongtin.net/2009/05/07/autoit-kiem-tra-nguoi-dung-viet-gi/" rel="bookmark">AutoIt - Kiểm tra người dùng viết gì.</a></li><li><a href="http://blog.thuongtin.net/2009/06/29/php-display-server-load/" rel="bookmark">[PHP] Display Server Load</a></li><li><a href="http://blog.thuongtin.net/2009/09/15/chinh-time-cua-server-theo-gio-vn/" rel="bookmark">Chỉnh time của server theo giờ VN</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=429&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2009/05/26/php-chuyen-tu-ip-sang-country-ip-2-country/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chuyển đổi các múi giờ</title>
		<link>http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/</link>
		<comments>http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 04:06:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=343</guid>
		<description><![CDATA[Converting Between Different Time Zones
&#60;?php
// function to get time
// for another time zone
// given a specific timestamp and hour offset from GMT

function getLocalTime($ts, $offset) {
// performs conversion
// returns UNIX timestamp
return ($ts - date(&#34;Z&#34;, $ts)) + (3600 * $offset);
}
// get current local time in Singapore
// result: &#34;00:11:26 31-10-06 SST&#34;
echo date(&#34;H:i:s d-m-y&#34;, getLocalTime(mktime(), 8)) . &#34; SST ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first"><span style="font-style: italic;">Converting Between Different Time Zones</span></p>
<pre class="brush: php;">&lt;?php
// function to get time
// for another time zone
// given a specific timestamp and hour offset from GMT

function getLocalTime($ts, $offset) {
// performs conversion
// returns UNIX timestamp
return ($ts - date(&quot;Z&quot;, $ts)) + (3600 * $offset);
}
// get current local time in Singapore
// result: &quot;00:11:26 31-10-06 SST&quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(), 8)) . &quot; SST \n&quot;;
// get current local time in India
// result: &quot;21:41:26 30-10-06 IST&quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(), +5.5)) . &quot; IST \n&quot;;
// get current local time in USA (Eastern)
// result: &quot;11:11:26 30-10-06 EST&quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(), -5)) . &quot; EST \n&quot;;
// get current local time in USA (Pacific)
// result: &quot;08:11:26 30-10-06 PST&quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(), -8)) . &quot; PST \n&quot;;
// get time in GMT
// when it is 04:30 AM in India
// result: &quot;23:00:00 01-02-05 GMT &quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(4,30,0,2,2,2005), 0)) .?
&quot; GMT \n&quot;;
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/" rel="bookmark">So sánh 2 ngày</a></li><li><a href="http://blog.thuongtin.net/2008/10/29/so-sanh-2-ngay-comparing-dates/" rel="bookmark">So sánh 2 ngày - Comparing Dates</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/tao-1-file-download-file/" rel="bookmark">Tạo 1 file download file</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/class-login/" rel="bookmark">Class login</a></li><li><a href="http://blog.thuongtin.net/2008/10/29/chuyen-doi-phut-sang-gio-va-nguoc-lai/" rel="bookmark">Chuyển đổi phút sang giờ và ngược lại</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=343&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chuyển đổi phút sang giờ và ngược lại</title>
		<link>http://blog.thuongtin.net/2008/11/18/chuyen-doi-phut-sang-gio-va-nguoc-lai-2/</link>
		<comments>http://blog.thuongtin.net/2008/11/18/chuyen-doi-phut-sang-gio-va-nguoc-lai-2/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 04:00:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=340</guid>
		<description><![CDATA[Converting Minutes to Hours
Phút qua giờ:

&#60;?php
// define number of minutes
$mm = 156;
// convert to hh:mm format
// result: &#34;02h 36m&#34;
echo sprintf(&#34;%02dh %02dm&#34;, floor($mm/60), $mm%60);
?&#62;

Ngược lại:

&#60;?php
// define hours and minutes
$hhmm = &#34;02:36&#34;;
// convert to minutes
// result: &#34;156 minutes&#34;
$arr = explode(&#34;:&#34;, $hhmm);
echo $arr[0]*60 + $arr[1] . &#34; minutes&#34;;
?&#62;

Related Posts:Chuyển đổi phút sang giờ và ngược lạiPHP Function to ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first"><span style="font-style: italic;">Converting Minutes to Hours</span></p>
<p><strong>Phút qua giờ</strong>:</p>
<pre class="brush: php;">
&lt;?php
// define number of minutes
$mm = 156;
// convert to hh:mm format
// result: &quot;02h 36m&quot;
echo sprintf(&quot;%02dh %02dm&quot;, floor($mm/60), $mm%60);
?&gt;
</pre>
<p><strong>Ngược lại:</strong></p>
<pre class="brush: php;">
&lt;?php
// define hours and minutes
$hhmm = &quot;02:36&quot;;
// convert to minutes
// result: &quot;156 minutes&quot;
$arr = explode(&quot;:&quot;, $hhmm);
echo $arr[0]*60 + $arr[1] . &quot; minutes&quot;;
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/10/29/chuyen-doi-phut-sang-gio-va-nguoc-lai/" rel="bookmark">Chuyển đổi phút sang giờ và ngược lại</a></li><li><a href="http://blog.thuongtin.net/2008/11/04/php-function-to-calculate-time-remaining/" rel="bookmark">PHP Function to calculate time remaining</a></li><li><a href="http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/" rel="bookmark">Chuyển đổi các múi giờ</a></li><li><a href="http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/" rel="bookmark">8 mẫu Regular Expressions hữu ích</a></li><li><a href="http://blog.thuongtin.net/2008/09/11/mot-so-cach-xu-ly-chuoi/" rel="bookmark">Một số cách xử lý chuỗi</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=340&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/18/chuyen-doi-phut-sang-gio-va-nguoc-lai-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>So sánh 2 ngày</title>
		<link>http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/</link>
		<comments>http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 03:58:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=338</guid>
		<description><![CDATA[Comparing Dates

&#60;?php
// create timestamps for two dates
$date1 = mktime(0,0,0,2,1,2007);
$date2 = mktime(1,0,0,2,1,2007);
// compare timestamps
// to see which represents an earlier date
if ($date1 &#62; $date2) {
$str = date (&#34;d-M-Y H:i:s&#34;, $date2) . &#34; comes before &#34; .?
date (&#34;d-M-Y H:i:s&#34;, $date1);
} else if ($date2 &#62; $date1) {
$str = date (&#34;d-M-Y H:i:s&#34;, $date1) . &#34; comes before &#34; .?
date ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first"><span style="font-style: italic;">Comparing Dates</span></p>
<pre class="brush: php;">
&lt;?php
// create timestamps for two dates
$date1 = mktime(0,0,0,2,1,2007);
$date2 = mktime(1,0,0,2,1,2007);
// compare timestamps
// to see which represents an earlier date
if ($date1 &gt; $date2) {
$str = date (&quot;d-M-Y H:i:s&quot;, $date2) . &quot; comes before &quot; .?
date (&quot;d-M-Y H:i:s&quot;, $date1);
} else if ($date2 &gt; $date1) {
$str = date (&quot;d-M-Y H:i:s&quot;, $date1) . &quot; comes before &quot; .?
date (&quot;d-M-Y H:i:s&quot;, $date2);
} else {
$str = &quot;Dates are equal&quot;;
}
// result: &quot;01-Feb-2007 00:00:00 comes before 01-Feb-2007 01:00:00&quot;
echo $str;
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/10/29/so-sanh-2-ngay-comparing-dates/" rel="bookmark">So sánh 2 ngày - Comparing Dates</a></li><li><a href="http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/" rel="bookmark">Chuyển đổi các múi giờ</a></li><li><a href="http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/" rel="bookmark">8 mẫu Regular Expressions hữu ích</a></li><li><a href="http://blog.thuongtin.net/2008/09/09/gui-email-dang-html-voi-ham-mail/" rel="bookmark">Gửi email dạng HTML với hàm mail()</a></li><li><a href="http://blog.thuongtin.net/2008/09/10/class-curl/" rel="bookmark">Class Curl</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=338&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>utf8 substr</title>
		<link>http://blog.thuongtin.net/2008/11/14/utf8-substr/</link>
		<comments>http://blog.thuongtin.net/2008/11/14/utf8-substr/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 06:34:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[substr]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=333</guid>
		<description><![CDATA[utf8 substr

&#60;?php
function utf8_substr($str,$from,$len){
return preg_replace('#^(?:[\x00-\x7F]&#124;[\xC0-\xFF][\x80-\xBF]+){0,'.$from.'}'.
'((?:[\x00-\x7F]&#124;[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*#s',
'$1',$str);
}
echo utf8_substr('người đi xa mãi',0,10);
?&#62;

Related Posts:Hàm kiểm tra file sizeLấy thời gian của tập tin .flvClass CurlHàm tính tuổiYoutube Download Link Generator]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">utf8 substr</p>
<pre class="brush: php;">
&lt;?php
function utf8_substr($str,$from,$len){
return preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$from.'}'.
'((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*#s',
'$1',$str);
}
echo utf8_substr('người đi xa mãi',0,10);
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/09/11/ham-kiem-tra-file-size/" rel="bookmark">Hàm kiểm tra file size</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/lay-thoi-gian-cua-tap-tin-flv/" rel="bookmark">Lấy thời gian của tập tin .flv</a></li><li><a href="http://blog.thuongtin.net/2008/09/10/class-curl/" rel="bookmark">Class Curl</a></li><li><a href="http://blog.thuongtin.net/2008/10/10/ham-tinh-tuoi/" rel="bookmark">Hàm tính tuổi</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/youtube-download-link-generator/" rel="bookmark">Youtube Download Link Generator</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=333&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/14/utf8-substr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Tính Can Chi</title>
		<link>http://blog.thuongtin.net/2008/11/05/php-tinh-can-chi/</link>
		<comments>http://blog.thuongtin.net/2008/11/05/php-tinh-can-chi/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 08:02:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[can chi]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=311</guid>
		<description><![CDATA[Xác định 1 năm can chi là gì, cái này tớ chuyển từ C qua 
Đây là hàm php đã chuyển:

&#60;?php
function canchi($nam)
{
$acan = array(&#34;Giap&#34;, &#34;At&#34;, &#34;Binh&#34;, &#34;Dinh&#34;, &#34;Mau&#34;, &#34;Ky&#34;, &#34;Canh&#34;, &#34;Tan&#34;, &#34;Nham&#34;, &#34;Quy&#34;);
$achi = array(&#34;Ty&#34;, &#34;Suu&#34;, &#34;Dan&#34;, &#34;Meo&#34;, &#34;Thin&#34;, &#34;Ty&#34;, &#34;Ngo&#34;, &#34;Mao&#34;, &#34;Than&#34;, &#34;Dau&#34;, &#34;Tuat&#34;, &#34;Hoi&#34;);
$can = $acan[($nam+6)%10];
$chi = $achi[($nam+8)%12];
return $can.&#34; &#34;.$chi;
}
echo canchi(1988);
?&#62;

Còn đây là ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">Xác định 1 năm can chi là gì, cái này tớ chuyển từ C qua <img src='http://blog.thuongtin.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Đây là hàm php đã chuyển:</p>
<pre class="brush: php;">
&lt;?php
function canchi($nam)
{
$acan = array(&quot;Giap&quot;, &quot;At&quot;, &quot;Binh&quot;, &quot;Dinh&quot;, &quot;Mau&quot;, &quot;Ky&quot;, &quot;Canh&quot;, &quot;Tan&quot;, &quot;Nham&quot;, &quot;Quy&quot;);
$achi = array(&quot;Ty&quot;, &quot;Suu&quot;, &quot;Dan&quot;, &quot;Meo&quot;, &quot;Thin&quot;, &quot;Ty&quot;, &quot;Ngo&quot;, &quot;Mao&quot;, &quot;Than&quot;, &quot;Dau&quot;, &quot;Tuat&quot;, &quot;Hoi&quot;);
$can = $acan[($nam+6)%10];
$chi = $achi[($nam+8)%12];
return $can.&quot; &quot;.$chi;
}
echo canchi(1988);
?&gt;
</pre>
<p>Còn đây là C:</p>
<pre class="brush: cpp;">#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;
void main()
{
unsigned nam;
char can[][5] = {&quot;Giap&quot;, &quot;At&quot;, &quot;Binh&quot;, &quot;Dinh&quot;, &quot;Mau&quot;, &quot;Ky&quot;,
&quot;Canh&quot;, &quot;Tan&quot;, &quot;Nham&quot;, &quot;Quy&quot;};
char chi[][5] = {&quot;Ty&quot;, &quot;Suu&quot;, &quot;Dan&quot;, &quot;Meo&quot;, &quot;Thin&quot;, &quot;Ty&quot;,
&quot;Ngo&quot;, &quot;Mao&quot;, &quot;Than&quot;, &quot;Dau&quot;, &quot;Tuat&quot;, &quot;Hoi&quot;};

printf(&quot;\nNhap nam can biet : &quot;);
scanf(&quot;%d&quot;, &amp;amp;amp;nam);
printf(&quot;Nam am lich cua %d la %s %s\n\n&quot;, nam, can[(nam+6)%10], chi[(nam+8)%12]);
getch();
}
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/11/05/may-tinh-don-gian-bang-c/" rel="bookmark">Máy tính đơn giản bằng C</a></li><li><a href="http://blog.thuongtin.net/2008/11/04/chuyen-so-thanh-so-la-ma/" rel="bookmark">Chuyển số thành số La Mã</a></li><li><a href="http://blog.thuongtin.net/2008/09/09/loc-dau-tieng-viet/" rel="bookmark">Lọc dấu tiếng Việt</a></li><li><a href="http://blog.thuongtin.net/2008/10/10/ham-tinh-tuoi/" rel="bookmark">Hàm tính tuổi</a></li><li><a href="http://blog.thuongtin.net/2008/11/03/lap-trinh-huong-doi-tuong-can-ban/" rel="bookmark">Lập trình hướng đối tượng căn bản</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=311&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/05/php-tinh-can-chi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Function to calculate time remaining</title>
		<link>http://blog.thuongtin.net/2008/11/04/php-function-to-calculate-time-remaining/</link>
		<comments>http://blog.thuongtin.net/2008/11/04/php-function-to-calculate-time-remaining/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 04:03:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=306</guid>
		<description><![CDATA[PHP Function to calculate time remaining.
//FUNCTION FOR TIME LEFT
function time_left($integer)
{

$seconds=$integer;

if ($seconds/60 &#62;=1)

{

$minutes=floor($seconds/60);

if ($minutes/60 &#62;= 1)

{ # Hours

$hours=floor($minutes/60);

if ($hours/24 &#62;= 1)

{ #days

$days=floor($hours/24);

if ($days/7 &#62;=1)

{ #weeks

$weeks=floor($days/7);

if ($weeks&#62;=2) $return=&#34;$weeks Weeks&#34;;

else $return=&#34;$weeks Week&#34;;

} #end of weeks

$days=$days-(floor($days/7))*7;

if ($weeks&#62;=1 &#38;&#38; $days &#62;=1) $return=&#34;$return, &#34;;

if ($days &#62;=2) $return=&#34;$return $days days&#34;;

if ($days ==1) $return=&#34;$return $days day&#34;;

} #end of days

$hours=$hours-(floor($hours/24))*24;

if ($days&#62;=1 &#38;&#38; $hours &#62;=1) ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">PHP Function to calculate time remaining.</p>
<pre class="brush: php;">//FUNCTION FOR TIME LEFT
function time_left($integer)
{

$seconds=$integer;

if ($seconds/60 &gt;=1)

{

$minutes=floor($seconds/60);

if ($minutes/60 &gt;= 1)

{ # Hours

$hours=floor($minutes/60);

if ($hours/24 &gt;= 1)

{ #days

$days=floor($hours/24);

if ($days/7 &gt;=1)

{ #weeks

$weeks=floor($days/7);

if ($weeks&gt;=2) $return=&quot;$weeks Weeks&quot;;

else $return=&quot;$weeks Week&quot;;

} #end of weeks

$days=$days-(floor($days/7))*7;

if ($weeks&gt;=1 &amp;&amp; $days &gt;=1) $return=&quot;$return, &quot;;

if ($days &gt;=2) $return=&quot;$return $days days&quot;;

if ($days ==1) $return=&quot;$return $days day&quot;;

} #end of days

$hours=$hours-(floor($hours/24))*24;

if ($days&gt;=1 &amp;&amp; $hours &gt;=1) $return=&quot;$return, &quot;;

if ($hours &gt;=2) $return=&quot;$return $hours hours&quot;;

if ($hours ==1) $return=&quot;$return $hours hour&quot;;

} #end of Hours

$minutes=$minutes-(floor($minutes/60))*60;

if ($hours&gt;=1 &amp;&amp; $minutes &gt;=1) $return=&quot;$return, &quot;;

if ($minutes &gt;=2) $return=&quot;$return $minutes minutes&quot;;

if ($minutes ==1) $return=&quot;$return $minutes minute&quot;;

} #end of minutes

$seconds=$integer-(floor($integer/60))*60;

if ($minutes&gt;=1 &amp;&amp; $seconds &gt;=1) $return=&quot;$return, &quot;;

if ($seconds &gt;=2) $return=&quot;$return $seconds seconds&quot;;

if ($seconds ==1) $return=&quot;$return $seconds second&quot;;

$return=&quot;$return.&quot;;

return $return;

}

/* Returns a string of the amount of time the integer (in seconds) refers
to.

$timeleft=time_left(86400);

$timeleft='1 day'.

Will not return anything higher than weeks. False if $integer=0 or fails.

*/
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/10/29/chuyen-doi-phut-sang-gio-va-nguoc-lai/" rel="bookmark">Chuyển đổi phút sang giờ và ngược lại</a></li><li><a href="http://blog.thuongtin.net/2008/11/18/chuyen-doi-phut-sang-gio-va-nguoc-lai-2/" rel="bookmark">Chuyển đổi phút sang giờ và ngược lại</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/lay-thoi-gian-cua-tap-tin-flv/" rel="bookmark">Lấy thời gian của tập tin .flv</a></li><li><a href="http://blog.thuongtin.net/2008/11/04/chuyen-so-thanh-so-la-ma/" rel="bookmark">Chuyển số thành số La Mã</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/file-sao-luu-du-lieu/" rel="bookmark">File sao lưu dữ liệu</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=306&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/04/php-function-to-calculate-time-remaining/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
