<?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>เทคนิคการเขียนเว็บ เขียนโปรแกรม php คัดมา เน้น ๆ : webshowpow.com &#187; website</title>
	<atom:link href="http://www.webshowpow.com/tag/website/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webshowpow.com</link>
	<description>เทคนิคการเขียนเว็บ เขียนโปรแกรม php คัดมา เน้น ๆ</description>
	<lastBuildDate>Thu, 01 Dec 2011 10:20:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>function แปลง tis620 เป็น utf8</title>
		<link>http://www.webshowpow.com/%e0%b9%81%e0%b8%9b%e0%b8%a5%e0%b8%87-tis620-%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99-utf8/</link>
		<comments>http://www.webshowpow.com/%e0%b9%81%e0%b8%9b%e0%b8%a5%e0%b8%87-tis620-%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99-utf8/#comments</comments>
		<pubDate>Wed, 25 May 2011 16:34:13 +0000</pubDate>
		<dc:creator>แว่นตก</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[tis620]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[สามารถ]]></category>
		<category><![CDATA[เปลี่ยน]]></category>
		<category><![CDATA[แปลง]]></category>
		<category><![CDATA[ไม่]]></category>

		<guid isPermaLink="false">http://www.webshowpow.com/?p=93</guid>
		<description><![CDATA[ในการเขียนเวปไซด์บ้างครั้งเรามีความจำเป็นที่จะต้องแปลง unicode ไปมาระหว่าง tis620 เป็น utf8 หรือจาก utf8 เป็น tis620 ผมขอยกตัวอย่างเคสที่ต้องเปลี่ยน unicode เช่น db เป็น tis620 แต่หน้าเวปไซด์เรา เป็น utf8 และเราไม่สามารถที่จะเ้ปลี่ยนจาก db เป็น utf8 และเราก็ไม่สามารถเปลี่ยนเวปไซด์เป็น tis620 ได้ เราต้องใช้ function ดังกล่าวเปลี่ยน unicode [...]]]></description>
			<content:encoded><![CDATA[<p>ในการเขียนเวปไซด์บ้างครั้งเรามีความจำเป็นที่จะต้องแปลง unicode<br />
ไปมาระหว่าง tis620 เป็น utf8 หรือจาก utf8 เป็น tis620<br />
ผมขอยกตัวอย่างเคสที่ต้องเปลี่ยน unicode<br />
เช่น db เป็น tis620 แต่หน้าเวปไซด์เรา เป็น utf8<br />
และเราไม่สามารถที่จะเ้ปลี่ยนจาก db เป็น utf8<br />
และเราก็ไม่สามารถเปลี่ยนเวปไซด์เป็น tis620 ได้<br />
เราต้องใช้ function ดังกล่าวเปลี่ยน unicode ครับ</p>
<p><strong>function ในการแปลงจาก tis620 เป็น utf8</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> tis620_to_utf8<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tis</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tis</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$s</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tis</span><span style="color: #339933;">,</span> <span style="color: #000088;">$i</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$val</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$s</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$val</span> <span style="color: #339933;">&lt;</span> <span style="color: #208080;">0x80</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	 <span style="color: #000088;">$utf8</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$s</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #208080;">0xA1</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$val</span> and <span style="color: #000088;">$val</span> <span style="color: #339933;">&lt;=</span> <span style="color: #208080;">0xDA</span><span style="color: #009900;">&#41;</span> 
              or <span style="color: #009900;">&#40;</span><span style="color: #208080;">0xDF</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$val</span> and <span style="color: #000088;">$val</span> <span style="color: #339933;">&lt;=</span> <span style="color: #208080;">0xFB</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
	 <span style="color: #000088;">$unicode</span> <span style="color: #339933;">=</span> <span style="color: #208080;">0x0E00</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$val</span> <span style="color: #339933;">-</span> <span style="color: #208080;">0xA0</span><span style="color: #339933;">;</span>
	 <span style="color: #000088;">$utf8</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span> <span style="color: #208080;">0xE0</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$unicode</span> <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	 <span style="color: #000088;">$utf8</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span> <span style="color: #208080;">0x80</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$unicode</span> <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3F</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	 <span style="color: #000088;">$utf8</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span> <span style="color: #208080;">0x80</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$unicode</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3F</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$utf8</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>function ในการแปลงจาก utf8 เป็น tis620</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> utf8_to_tis620<span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$string</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">224</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	  <span style="color: #000088;">$unicode</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3F</span><span style="color: #339933;">;</span>
	  <span style="color: #000088;">$unicode</span> <span style="color: #339933;">|=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3F</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #cc66cc;">6</span><span style="color: #339933;">;</span>
	  <span style="color: #000088;">$unicode</span> <span style="color: #339933;">|=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x0F</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #cc66cc;">12</span><span style="color: #339933;">;</span>
	  <span style="color: #000088;">$res</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$unicode</span><span style="color: #339933;">-</span><span style="color: #208080;">0x0E00</span><span style="color: #339933;">+</span><span style="color: #208080;">0xA0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #000088;">$i</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	  <span style="color: #000088;">$res</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$res</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webshowpow.com/%e0%b9%81%e0%b8%9b%e0%b8%a5%e0%b8%87-tis620-%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99-utf8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Light Box JS v2.0</title>
		<link>http://www.webshowpow.com/light-box-js-v2-0/</link>
		<comments>http://www.webshowpow.com/light-box-js-v2-0/#comments</comments>
		<pubDate>Wed, 25 May 2011 10:57:18 +0000</pubDate>
		<dc:creator>แว่นตก</dc:creator>
				<category><![CDATA[Cool Web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[light box]]></category>
		<category><![CDATA[popup]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[สวย]]></category>

		<guid isPermaLink="false">http://www.webshowpow.com/?p=15</guid>
		<description><![CDATA[เวปที่แนะนำการแสดงผลรูปภาพแบบใหม่ เป็นเวปแรก ๆ ที่ให้แสดงผลแบบนี้ สมัยนี้จึงเรียกการแสดงผลลักษณะนี้ ว่า แสดงผลแบบ lightbox ถึงแม้ว่าจะไม่ได้ใช้ lightbox ก็ตาม เหอะๆๆ http://www.huddletogether.com/projects/lightbox2 &#160; น่าปลื้มใจแทน lightbox จริง ๆ ที่มีคน copy idea เหอะ ๆ &#160;]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.webshowpow.com/wp-content/uploads/2009/06/lightbox.jpg" alt="รูปของเทคนิค Light Box JS v2.0" title="รูปของเทคนิค Light Box JS v2.0" width="550" height="225" class="alignnone size-full wp-image-211" /></p>
<p>เวปที่แนะนำการแสดงผลรูปภาพแบบใหม่<br />
เป็นเวปแรก ๆ ที่ให้แสดงผลแบบนี้ สมัยนี้จึงเรียกการแสดงผลลักษณะนี้<br />
ว่า แสดงผลแบบ lightbox ถึงแม้ว่าจะไม่ได้ใช้ lightbox ก็ตาม</p>
<p>เหอะๆๆ</p>
<p><a href="http://www.huddletogether.com/projects/lightbox2" target="_blank">http://www.huddletogether.com/projects/lightbox2</a></p>
<p>&nbsp;</p>
<blockquote><p>น่าปลื้มใจแทน lightbox จริง ๆ ที่มีคน copy idea เหอะ ๆ</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webshowpow.com/light-box-js-v2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

