<?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>Life["Breathing"] &#187; php</title>
	<atom:link href="http://blog.hsin.tw/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hsin.tw</link>
	<description></description>
	<lastBuildDate>Fri, 06 Jan 2012 10:42:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>[CodeIgniter] extend CI_Model</title>
		<link>http://blog.hsin.tw/2011/codeigniter-extend-ci_model/</link>
		<comments>http://blog.hsin.tw/2011/codeigniter-extend-ci_model/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 08:43:53 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=474</guid>
		<description><![CDATA[建立自己的程式庫 在這頁寫到可以擴充原有的程式庫，我想增加幾個基本的Method（CRUD之類的）到原有的CI_Model，這樣就不用每個Model檔案都寫一遍。雖然這頁說明寫說要放在 application/libraries 中，但是CodeIgniter 2的Model已經是歸在Core中了，所以其實是要把MY_Model.php放在 application/core 才對。 1. 建立一個新檔案 MY_Model.php（MY_可在application/config/config.php修改） 2. 將檔案放在 application/core 中 3. 之後新的Model檔案要extends的是MY_Model，而不是CI_Model。 收工]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codeigniter.org.tw/user_guide/general/creating_libraries.html" target="_blank">建立自己的程式庫</a><br />
<span id="more-474"></span><br />
在這頁寫到可以擴充原有的程式庫，我想增加幾個基本的Method（CRUD之類的）到原有的CI_Model，這樣就不用每個Model檔案都寫一遍。雖然這頁說明寫說要放在 <strong>application/libraries </strong>中，但是CodeIgniter 2的Model已經是歸在Core中了，所以其實是要把MY_Model.php放在 <strong>application/core </strong>才對。</p>
<p>1. 建立一個新檔案 MY_Model.php（<strong>MY_</strong>可在<strong>application/config/config.php</strong>修改）</p>
<pre class="brush: php; title: ; notranslate">
class MY_Model extends CI_Model{
    function __construct()    {
        parent::__construct();
    }

    // some methods
}
</pre>
<p>2. 將檔案放在 <strong>application/core</strong> 中</p>
<p>3. 之後新的Model檔案要extends的是MY_Model，而不是CI_Model。</p>
<p>收工</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2011/codeigniter-extend-ci_model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeigniter開啟csrf protection時 傳送表單(or ajax)</title>
		<link>http://blog.hsin.tw/2011/codeigniter-csrf-protection-form-ajax/</link>
		<comments>http://blog.hsin.tw/2011/codeigniter-csrf-protection-form-ajax/#comments</comments>
		<pubDate>Wed, 18 May 2011 10:37:42 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=449</guid>
		<description><![CDATA[在CI 2.0中有一個csrf(Cross Site Request Forgery) protection的功能 如果打開這個功能的話 post表單給server 會吐 error 500 An Error Was Encountered The action you have requested is not allowed. 會無法執行 這時候要在表單傳送的數值中加入一個token的值 才能正常使用表單功能 可以在application/config/config.php中找到下面這幾行 原本$config['csrf_protection']預設是FALSE 改成TRUE就可以打開了 開啟之後 會自動幫你在cookie中存一個值 cookie的name在上面說的config.php中可以設定 之後傳送表單就要連這個token一起傳才行 以下用jquery的ajax功能示範 getCookie()是用js取出cookie的值 這是在網路上找到的 可以直接拿去用 而csrf_test_name就是在config.php中可以設定的參數 將這個cookie抓出來一起送出表單 就可以正常使用了 &#8230; <a href="http://blog.hsin.tw/2011/codeigniter-csrf-protection-form-ajax/">繼續閱讀 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>在CI 2.0中有一個csrf(Cross Site Request Forgery) protection的功能<br />
<span id="more-449"></span><br />
如果打開這個功能的話<br />
post表單給server 會吐 error 500<br />
An Error Was Encountered<br />
The action you have requested is not allowed.<br />
會無法執行<br />
這時候要在表單傳送的數值中加入一個token的值<br />
才能正常使用表單功能</p>
<p>可以在application/config/config.php中找到下面這幾行</p>
<pre class="brush: php; title: ; notranslate">
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
</pre>
<p>原本$config['csrf_protection']預設是FALSE 改成TRUE就可以打開了<br />
開啟之後 會自動幫你在cookie中存一個值<br />
cookie的name在上面說的config.php中可以設定<br />
之後傳送表單就要連這個token一起傳才行</p>
<p>以下用jquery的ajax功能示範</p>
<pre class="brush: jscript; title: ; notranslate">
$(function(){
    $('#btn').click(function(){
	    $.ajax({
	        type:'POST'
	        ,url:'/ajax' //ajax接收的server端
	        ,data:$('#form').serialize()+'&amp;csrf_test_name='+ getCookie('csrf_test_name')
	        ,success:function(data){
			alert(data.msg);
	        }
	        ,dataType:'json'
	    });
    });
});

function getCookie(name){
    var arr = document.cookie.match(new RegExp(&quot;(^| )&quot;+name+&quot;=([^;]*)(;|$)&quot;));
    if(arr != null) return unescape(arr[2]); return null;
}
</pre>
<p>getCookie()是用js取出cookie的值<br />
這是在網路上找到的 可以直接拿去用</p>
<p>而csrf_test_name就是在config.php中可以設定的參數<br />
將這個cookie抓出來一起送出表單<br />
就可以正常使用了</p>
<p>有任何指教歡迎留言~</p>
<p>referer : <a href="http://ericlbarnes.com/blog/post/codeigniter_csrf_protection_with_ajax">http://ericlbarnes.com/blog/post/codeigniter_csrf_protection_with_ajax</a></p>
<p>==================<br />
update<br />
==================<br />
依據這頁<a href="http://codeigniter.com/forums/viewthread/163976/">http://codeigniter.com/forums/viewthread/163976/</a> 某樓提供的方法<br />
可以使用以下方法取得token_name以及值</p>
<pre class="brush: php; title: ; notranslate">
&lt;input type=&quot;hidden&quot; name=&quot;&lt;?php echo $this-&gt;security-&gt;csrf_token_name?&gt;&quot; value=&quot;&lt;?php echo $this-&gt;security-&gt;csrf_hash?&gt;&quot; /&gt;
</pre>
<p>滿方便的<br />
另外還有一點就是<br />
如果是用CI內建的form helper<br />
在開啟csrf_protection時 會自動幫你加入這個token的值<br />
我本身是沒有在用啦<br />
如果有在用的人 就會比較方便囉 (或許根本就不會發現這個問題XD)<br />
==================<br />
以上是update的資訊<br />
==================</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2011/codeigniter-csrf-protection-form-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 取得EXIF中GPS的經緯度</title>
		<link>http://blog.hsin.tw/2011/php-exif-gps-latitude-longitude/</link>
		<comments>http://blog.hsin.tw/2011/php-exif-gps-latitude-longitude/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 02:31:32 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[exif]]></category>
		<category><![CDATA[gps]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=422</guid>
		<description><![CDATA[在php4.2之後有一個函數可以取得EXIF的內容 exif_read_data() 只可以用在JPG跟TIFF的圖片 餵其他類型的會絡賽 首先當然就是先取得EXIF的內容 第一個欄位是檔案 第二個欄位是要取哪些項目(可以去文件看)的資訊 第三個是將各項目的值以array返回 都是各有三個元素的array 各代表度,分,秒 但是他們都長得怪怪的 會是分數的形式 所以需要再將他們解析 找到一篇解法 PHP extract GPS EXIF data 把兩個值丟進去就可以了 也就是這樣 就可以再做之後的應用啦 可以用google map確認一下對不對 http://maps.google.com.tw/?q=25 2 52.8,121 33 58.2 ===update=== 發現還要判斷南北半球 東西半球]]></description>
			<content:encoded><![CDATA[<p>在php4.2之後有一個函數可以取得EXIF的內容<br />
<span id="more-422"></span><br />
<a href="http://php.net/manual/en/function.exif-read-data.php">exif_read_data()</a><br />
只可以用在JPG跟TIFF的圖片<br />
餵其他類型的會絡賽</p>
<p>首先當然就是先取得EXIF的內容<br />
第一個欄位是檔案 第二個欄位是要取哪些項目(可以去文件看)的資訊<br />
第三個是將各項目的值以array返回</p>
<pre class="brush: php; title: ; notranslate">
$exif = exif_read_data('my.jpg', 0, true);
//緯度
$latitude = $exif['GPS']['GPSLatitude'];
//經度
$longitude = $exif['GPS']['GPSLongitude'];
</pre>
<p>都是各有三個元素的array 各代表度,分,秒<br />
但是他們都長得怪怪的 會是分數的形式<br />
所以需要再將他們解析<br />
找到一篇解法<br />
<a href="http://stackoverflow.com/questions/2526304/php-extract-gps-exif-data">PHP extract GPS EXIF data</a><br />
把兩個值丟進去就可以了</p>
<pre class="brush: php; title: ; notranslate">
//Pass in GPS.GPSLatitude or GPS.GPSLongitude or something in that format
function getGps($exifCoord)
{
  $degrees = count($exifCoord) &gt; 0 ? gps2Num($exifCoord[0]) : 0;
  $minutes = count($exifCoord) &gt; 1 ? gps2Num($exifCoord[1]) : 0;
  $seconds = count($exifCoord) &gt; 2 ? gps2Num($exifCoord[2]) : 0;

  //normalize
  $minutes += 60 * ($degrees - floor($degrees));
  $degrees = floor($degrees);

  $seconds += 60 * ($minutes - floor($minutes));
  $minutes = floor($minutes);

  //extra normalization, probably not necessary unless you get weird data
  if($seconds &gt;= 60)
  {
    $minutes += floor($seconds/60.0);
    $seconds -= 60*floor($seconds/60.0);
  }

  if($minutes &gt;= 60)
  {
    $degrees += floor($minutes/60.0);
    $minutes -= 60*floor($minutes/60.0);
  }

  return array('degrees' =&gt; $degrees, 'minutes' =&gt; $minutes, 'seconds' =&gt; $seconds);
}

function gps2Num($coordPart)
{
  $parts = explode('/', $coordPart);

  if(count($parts)) &lt;= 0)
    return 0;
  if(count($parts)) == 1)
    return $parts[0];

  return floatval($parts[0]) / floatval($parts[1]);
}
</pre>
<p>也就是這樣</p>
<pre class="brush: php; title: ; notranslate">
$latitude = getGps($latitude);
$longitude = getGps($longitude);
/*
output:
緯度
度：$latitude['degrees']
分：$latitude['minutes']
秒：$latitude['seconds']
經度
度：$longitude['degrees']
分：$longitude['minutes']
秒：$longitude['seconds']
*/
</pre>
<p>就可以再做之後的應用啦<br />
可以用google map確認一下對不對<br />
<a href="http://maps.google.com.tw/?q=25 2 52.8,121 33 58.2">http://maps.google.com.tw/?q=25 2 52.8,121 33 58.2</a></p>
<p>===update===<br />
發現還要判斷南北半球 東西半球</p>
<pre class="brush: php; title: ; notranslate">
//這會出現S或是N 也就是南北半球
$exif['GPS']['GPSLatitudeRef'];
//如果是S的話 緯度還要乘-1喔

//這會出現W或是E 也就是東西半球
$exif['GPS']['GPSLongitudeRef'];
//如果是W的話 經度還要乘-1喔
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2011/php-exif-gps-latitude-longitude/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Codeigniter 使用flash上傳時 會吃不到session跟cookie</title>
		<link>http://blog.hsin.tw/2011/codeigniter-flash-upload-session-cookie-losing/</link>
		<comments>http://blog.hsin.tw/2011/codeigniter-flash-upload-session-cookie-losing/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 13:26:50 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Codeigniter]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=419</guid>
		<description><![CDATA[很巧的我就遇上了 我的圖片上傳是用這個uploadify 用ajax來作 就可以不用換頁的上傳圖片 但是很巧的他就是用flash上傳 而我也剛好用CI這個framework 試了很久 session跟cookie就是吃不到 後來在CI的forum找到有人說有這個問題 Session and cookie information lost when using Flash 看起來是還沒有修好 雖然是有解法 但是是要修改core classes裡的東西 似乎不太妥當 所以目前就先改別的方式囉 如果有好心人知道怎麼解的話 也請不吝的告訴我~拜託啦~]]></description>
			<content:encoded><![CDATA[<p>很巧的我就遇上了<br />
<span id="more-419"></span><br />
我的圖片上傳是用這個<a href="http://www.uploadify.com/">uploadify</a><br />
用ajax來作<br />
就可以不用換頁的上傳圖片<br />
但是很巧的他就是用flash上傳<br />
而我也剛好用CI這個framework<br />
試了很久<br />
session跟cookie就是吃不到<br />
後來在CI的forum找到有人說有這個問題<br />
<a href="http://codeigniter.com/forums/viewthread/77044/">Session and cookie information lost when using Flash</a><br />
看起來是還沒有修好<br />
雖然是有解法<br />
但是是要修改core classes裡的東西<br />
似乎不太妥當<br />
所以目前就先改別的方式囉</p>
<p>如果有好心人知道怎麼解的話<br />
也請不吝的告訴我~拜託啦~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2011/codeigniter-flash-upload-session-cookie-losing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php 將數字補零 使用str_pad</title>
		<link>http://blog.hsin.tw/2009/php-pad-a-string/</link>
		<comments>http://blog.hsin.tw/2009/php-pad-a-string/#comments</comments>
		<pubDate>Mon, 11 May 2009 11:09:45 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=225</guid>
		<description><![CDATA[用php 補零去咕狗 會找到有些使用sprintf函式的方法 像下面這樣 其實php本身就有一個專門可以補齊位數的函式 : str_pad() string str_pad ( string $input , int $pad_length [, string $pad_string= " " [, int $pad_type= STR_PAD_RIGHT ]] ) $input : 原字串 $pad_length : 補齊後的位數 $pad_string : 用來補齊的字串 $pad_type : 補齊的方式 有三種，STR_PAD_RIGHT (由右邊補)、STR_PAD_LEFT &#8230; <a href="http://blog.hsin.tw/2009/php-pad-a-string/">繼續閱讀 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>用<a href="http://www.google.com.tw/search?q=php+%E8%A3%9C%E9%9B%B6&#038;ie=utf-8&#038;oe=utf-8&#038;aq=t&#038;rls=org.mozilla:zh-TW:official&#038;client=firefox-a" target="_blank">php 補零</a>去咕狗<br />
<span id="more-225"></span><br />
會找到有些使用sprintf函式的方法 像下面這樣</p>
<pre class="brush: php; title: ; notranslate">
$var = 1;
echo sprintf(&quot;%02d&quot;, $var);
</pre>
<p>其實php本身就有一個專門可以補齊位數的函式 : <a href="http://tw2.php.net/str_pad" target="_blank">str_pad()</a></p>
<p>string str_pad  ( string $input  , int $pad_length  [, string $pad_string= " "  [, int $pad_type= STR_PAD_RIGHT  ]] )</p>
<p>$input : 原字串<br />
$pad_length : 補齊後的位數<br />
$pad_string : 用來補齊的字串<br />
$pad_type : 補齊的方式 有三種，STR_PAD_RIGHT (由右邊補)、STR_PAD_LEFT (由左邊補)、STR_PAD_BOTH (左右兩邊都補)， 預設為STR_PAD_RIGHT</p>
<p>所以其實不只可以補零，要補什麼字都可以<br />
而以補零來舉例的話就是</p>
<pre class="brush: php; title: ; notranslate">
$value = 7;
//將數字由左邊補零至三位數
$value = str_pad($value,3,'0',STR_PAD_LEFT);
echo $value;
// 結果會印出 007;

//下面這是document裡的例子
$input = &quot;Alien&quot;;
echo str_pad($input, 10);                      // produces &quot;Alien     &quot;
echo str_pad($input, 10, &quot;-=&quot;, STR_PAD_LEFT);  // produces &quot;-=-=-Alien&quot;
echo str_pad($input, 10, &quot;_&quot;, STR_PAD_BOTH);   // produces &quot;__Alien___&quot;
echo str_pad($input, 6 , &quot;___&quot;);               // produces &quot;Alien_&quot;
</pre>
<p>這樣應該就可以瞭解這個函式的用法了~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2009/php-pad-a-string/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>php 設定跨子網域的SESSION</title>
		<link>http://blog.hsin.tw/2009/php-pass-session-data-between-subdomains/</link>
		<comments>http://blog.hsin.tw/2009/php-pass-session-data-between-subdomains/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 02:09:33 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=218</guid>
		<description><![CDATA[要在php中設定可以跨子網域使用同樣的SESSION 可以在php.ini中多加一行 要記得網域前的 . 喔 如果不能修改php.ini的話 就在每個要跨子網域的程式中加入下面這行 都要在session_start()之前喔 同樣的 網域前的 . 也是不能省的~ 這只能使用在不同子網域的同網域中喔 就是AAA.mydomain.com跟BBB.mydomain.com可以通 AA.mydomain.com跟BB.yourdomain.com不能通 因為是不同網域 參考資訊：Pass Sessions between subdomains in php]]></description>
			<content:encoded><![CDATA[<p>要在php中設定可以跨子網域使用同樣的SESSION<br />
<span id="more-218"></span><br />
可以在php.ini中多加一行</p>
<pre class="brush: plain; title: ; notranslate">

session.cookie_domain = .mydomain.com
</pre>
<p>要記得網域前的 <strong>.</strong> 喔</p>
<p>如果不能修改php.ini的話<br />
就在每個要跨子網域的程式中加入下面這行</p>
<pre class="brush: php; title: ; notranslate">

ini_set(&quot;session.cookie_domain&quot;, &quot;.mydomain.com&quot;);
</pre>
<p>都要在session_start()之前喔<br />
同樣的 網域前的 <strong>.</strong> 也是不能省的~</p>
<p>這只能使用在不同子網域的同網域中喔<br />
就是AAA<span style="color:#0000cc;">.mydomain.com</span>跟BBB<span style="color:#0000cc;">.mydomain.com</span>可以通<br />
AA<span style="color:#0000cc;">.mydomain.com</span>跟BB<span style="color:#cc0000;">.yourdomain.com</span>不能通 因為是不同網域</p>
<p>參考資訊：<a target="_blank" href="http://www.madcarrot.co.uk/2005/08/pass_sessions_b.html">Pass Sessions between subdomains in php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2009/php-pass-session-data-between-subdomains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php 傳送get到別的URL並取得回應內容 使用fsockopen</title>
		<link>http://blog.hsin.tw/2009/php-get-method-fsockopen/</link>
		<comments>http://blog.hsin.tw/2009/php-get-method-fsockopen/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 11:42:04 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=140</guid>
		<description><![CDATA[在這篇有提到傳送post的用法 另外說到如果只是要傳送get就可以直接使用fopen或是file_get_contents函式直接取得網頁內容 BUT！！！ 這兩天遇到了一個問題 如果因為安全性的關係 要把php.ini中的allow_url_fopen關起來(也就是off) 那就不能使用前述的函式來取得網頁內容 所以只好找另外的方法 也就是使用fsockopen模擬傳送~ (鏘鏘鏘～) 以下是php部份 參考資訊：http://www.maorr.com/read.php/447.htm]]></description>
			<content:encoded><![CDATA[<p>在<a target="_blank" href="http://blog.hsin.tw/2009/php-post-method-fsockopen/">這篇</a>有提到傳送post的用法<br />
<span id="more-140"></span><br />
另外說到如果只是要傳送get就可以直接使用fopen或是file_get_contents函式直接取得網頁內容<br />
BUT！！！<br />
這兩天遇到了一個問題<br />
如果因為安全性的關係<br />
要把php.ini中的allow_url_fopen關起來(也就是off)<br />
那就不能使用前述的函式來取得網頁內容<br />
所以只好找另外的方法<br />
也就是使用fsockopen模擬傳送~<br />
(鏘鏘鏘～)</p>
<p>以下是php部份</p>
<pre class="brush: php; title: ; notranslate">
function SendGET($_url){
  $url = parse_url($_url);
  $contents = '';
  $url_port = $url['port']==''?80:$url['port'];
  $fp = fsockopen($url['host'],$url_port);
  if($fp){
    $_request = $url['path'].($url['query']==''?'':'?'.$url['query']).($url['fragment']==''?'':'#'.$url['fragment']);
    fputs($fp,'GET '.(($_request=='')?'/':$_request).&quot; HTTP/1.0\r\n&quot;);
    fputs($fp,&quot;Host: &quot;.$url['host'].&quot;\n&quot;);
    fputs($fp,&quot;Content-type: application/x-www-form-urlencoded\n&quot;);
    fputs($fp,&quot;Connection: close\n\n&quot;);
    $line = fgets($fp,1024);
    if(!eregi(&quot;^HTTP/1\.. 200&quot;, $line)) return;
    else{
      $results = '';
      $contents = '';
      $inheader = 1;
      while(!feof($fp)){
        $line = fgets($fp,2048);
        if($inheader&amp;&amp;($line == &quot;\n&quot; || $line == &quot;\r\n&quot;)){
          $inheader = 0;
        }elseif(!$inheader){
          $contents .= $line;
        }
      }
      fclose($fp);
    }
  }
  return $contents;
}
</pre>
<pre class="brush: php; title: ; notranslate">
//使用方式很簡單
$url = 'http://someone.com:80/index.php?mode=go&amp;id=hsin#top';
//把網址填入參數即可
$_result = SendGET($url);
//回傳的值就是內容
print_r($_result);
</pre>
<p>參考資訊：<a target="_blank" href="http://www.maorr.com/read.php/447.htm">http://www.maorr.com/read.php/447.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2009/php-get-method-fsockopen/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>php 傳送POST到別的URL並取得回應內容 使用fsockopen</title>
		<link>http://blog.hsin.tw/2009/php-post-method-fsockopen/</link>
		<comments>http://blog.hsin.tw/2009/php-post-method-fsockopen/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 08:52:52 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=109</guid>
		<description><![CDATA[如果不需要傳送參數或是使用GET method傳送 可以直接使用fopen()或是file_get_contents()函式獲得回應內容 但是如果需要不經過表單就送出POST給某URL 就需要使用curl相關函式或是fsockopen()傳送 curl的用法比較簡單 可以咕狗看看(但是php必須要先安裝curl才可以用) 這邊要講的是fsockopen() 參考資訊：http://www.phpe.net/faq/71.shtml]]></description>
			<content:encoded><![CDATA[<p>如果不需要傳送參數或是使用GET method傳送<br />
<span id="more-109"></span><br />
可以直接使用fopen()或是file_get_contents()函式獲得回應內容<br />
但是如果需要不經過表單就送出POST給某URL<br />
就需要使用curl相關函式或是fsockopen()傳送<br />
curl的用法比較簡單<br />
可以咕狗看看(但是php必須要先安裝curl才可以用)<br />
這邊要講的是fsockopen()</p>
<pre class="brush: php; title: ; notranslate">
//接收POST參數的URL
$url = 'http://www.google.com';
//POST參數,在這個陣列裡,索引是name,值是value,沒有限定組數
$postdata = array('post_name'=&gt;'post_value','acc'=&gt;'hsin','nick'=&gt;'joe');
//函式回覆的值就是取得的內容
$result = sendpost($url,$postdata);

function sendpost($url, $data){
//先解析url 取得的資訊可以看看http://www.php.net/parse_url
$url = parse_url($url);
$url_port = $url['port']==''?(($url['scheme']=='https')?443:80):$url['port'];
if(!$url) return &quot;couldn't parse url&quot;;
//對要傳送的POST參數作處理
$encoded = &quot;&quot;;
while(list($k,$v)=each($data)){
  $encoded .= ($encoded?'&amp;':'');
  $encoded .= rawurlencode($k).&quot;=&quot;.rawurlencode($v);
}
//開啟一個socket
$fp = fsockopen($url['host'],$url_port);
if(!$fp) return &quot;Failed to open socket to &quot;.$url['host'];
//header的資訊
fputs($fp,'POST '.$url['path'].($url['query']?'?'.$url['query']:'').&quot; HTTP/1.0rn&quot;);
fputs($fp,&quot;Host: &quot;.$url['host'].&quot;n&quot;);
fputs($fp,&quot;Content-type: application/x-www-form-urlencodedn&quot;);
fputs($fp,&quot;Content-length: &quot;.strlen($encoded).&quot;n&quot;);
fputs($fp,&quot;Connection: closenn&quot;);
fputs($fp,$encoded.&quot;n&quot;);
//取得回應的內容
$line = fgets($fp,1024);
if(!eregi(&quot;^HTTP/1.. 200&quot;, $line)) return;
$results = &quot;&quot;;
$inheader = 1;
while(!feof($fp)){
  $line = fgets($fp,2048);
  if($inheader&amp;&amp;($line == &quot;n&quot; || $line == &quot;rn&quot;)){
    $inheader = 0;
  }elseif(!$inheader){
    $results .= $line;
  }
}
fclose($fp);
return $results;
}
</pre>
<p>參考資訊：<a href="http://www.phpe.net/faq/71.shtml" target="_blank">http://www.phpe.net/faq/71.shtml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2009/php-post-method-fsockopen/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>php 解析xml</title>
		<link>http://blog.hsin.tw/2008/php-parse-xml/</link>
		<comments>http://blog.hsin.tw/2008/php-parse-xml/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 15:52:18 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=101</guid>
		<description><![CDATA[php本身就有函數可以處理xml 這邊以本站的rss feed作例子 startElement、endElement、characterData 三個函式的名稱都可以自己訂喔 不是固定的 按這裡可以看範例 相關連結：用PHP解析XML update: 使用php5以上的朋友可以試試這兩個函式simplexml_load_string simplexml_load_file喔，方便很多～]]></description>
			<content:encoded><![CDATA[<p>php本身就有函數可以處理xml<br />
<span id="more-101"></span><br />
這邊以本站的rss feed作例子</p>
<pre class="brush: php; title: ; notranslate">
//取得xml檔
$xml_file='http://blog.hsin.tw/feed/';
//必須使用fopen開啟 不能直接用喔
$fp = fopen($xml_file,'r');
//這是php官網介紹使用外部連結時的fread方法
$contents = '';
while (!feof($fp)) {
  $contents .= fread($fp, 8192);
}
//首先建立一個解析器，編碼不是必要的，這邊設定utf-8
$xp = xml_parser_create('utf-8');
//建立起始和終止元素處理器 下面函式的地方會講
xml_set_element_handler($xp,&quot;startElement&quot;,&quot;endElement&quot;);
//建立資料處理器 下面函式的地方會講
xml_set_character_data_handler($xp,&quot;characterData&quot;);
//開始解析xml檔
$result = xml_parse($xp,$contents);
//我是處理成以標籤為索引、內容為值的陣列，以print_r印出來看結果
print_r($_request);
//起始元素處理器
//當遇到xml檔裡面的每個標籤&lt;tag&gt;時，就會開始呼叫這個函式處理
//我這裡是把每個標籤名稱都換成小寫，待會給資料處理器使用
function startElement($parser,$tag,$atts)
{
	global $_i,$_x,$_request;
	$_x = strtolower($tag);
  if($_x=='item')
    ++$_i;
}
//終止元素處理器
//當遇到xml檔裡面的每個標籤&lt;/tag&gt;結束時，就會開始呼叫這個函式處理
//我這裡沒有作任何處理
function endElement($parser,$tag)
{}
//資料處理器
//會對每個標籤中的內容作處理
//這裡是把標籤名稱設為索引、內容設為值
function characterData($parser,$d)
{
	global $_i,$_x,$_request;
	if(trim($d)!='')
	{
  	$_request[$_i][$_x]=$d;
  }
}
</pre>
<p>startElement、endElement、characterData<br />
三個函式的名稱都可以自己訂喔<br />
不是固定的</p>
<p><a href="http://ex.hsin.tw/index.php?type=php&#038;act=p01" target="_blank">按這裡可以看範例</a></p>
<p>相關連結：<a href="http://www.zishu.cn/blogview.asp?logID=383" target="_blank">用PHP解析XML</a></p>
<p>update:<br />
使用php5以上的朋友可以試試這兩個函式<a href="http://tw.php.net/simplexml_load_string" target="_blank">simplexml_load_string</a> <a href="http://tw.php.net/simplexml_load_file" target="_blank">simplexml_load_file</a>喔，方便很多～</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2008/php-parse-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php 解壓縮zip 使用pclzip</title>
		<link>http://blog.hsin.tw/2008/php-pclzip/</link>
		<comments>http://blog.hsin.tw/2008/php-pclzip/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 12:04:42 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=28</guid>
		<description><![CDATA[前幾天為了要讓人上傳壓縮檔所以咕狗了一下 然後就找到了這個pclZip，是一個class，所以很好使用，include檔案就可以用了。 其實他也可以壓縮檔案，只是我還用不到，所以下面講的都比較有關解壓縮。 這是最基本的用法： 這樣就可以把archive.zip這個檔案解壓縮到當前目錄！傷當的簡單阿！ 不過記得解壓縮到的目錄的權限要可以寫入，不然會卡住，我因為這個卡很久阿&#8230;很笨=..= 他每個method還可以加上許多的參數，可以讓壓縮檔更帥&#8230;(什麼鬼) 下面是我把官網上有寫的參數都翻一下，細節可以自己到這裡研究看看 參數 引數 說明 PCLZIP_OPT_PATH 字串 要解壓縮到哪的路徑。可用於extract()、extractByIndex()。 PCLZIP_OPT_ADD_PATH 字串 增加一個目錄。可用於create()、add()、extract()。(使用於create()時，是把要壓縮的檔案放進這個目錄中再壓縮，使用於extract()時，是在要解壓縮的路徑中增加此目錄，並解壓縮到此目錄中)。 PCLZIP_OPT_REMOVE_PATH 字串 移除部份的目錄路徑，例如原本檔案所在的目錄為aa/bb/cc/test.test.txt，但是希望壓縮或解壓縮後的路徑為cc/test.txt，就可以使用PCLZIP_OPT_REMOVE_PATH,"aa/bb"。可用於create()、add()、extract()、extractByIndex()。(與PCLZIP_OPT_REMOVE_ALL_PATH一起用的時候會被自動忽略) PCLZIP_OPT_REMOVE_ALL_PATH &#8211; 移除所有檔案的目錄，所有檔案都會被解壓縮或壓縮到當前或是指定的目錄中，請注意如果有不同目錄的相同名稱檔案，使用此參數時會被覆蓋，此參數不需要引數。可用於create()、add()、extract()、extractByIndex()。 PCLZIP_OPT_SET_CHMOD CHMOD值 設定解壓縮出來的檔案的CHMOD值。可用於extract()、extractByIndex()。 PCLZIP_OPT_BY_NAME 檔案名稱 僅解壓縮引數中所指定的檔案，檔案名稱可以用陣列或是逗號隔開表示。 PCLZIP_OPT_BY_EREG RegEx字串 僅解壓縮引數中正規表達式比對檔名正確的檔案，使用php中的ereg()函式比對。 PCLZIP_OPT_BY_PREG RegEx字串 僅解壓縮引數中正規表達式比對檔名正確的檔案，使用php中的preg_match()函式比對。 PCLZIP_OPT_BY_INDEX 陣列 僅解壓縮引數陣列中各元素所指定順序的檔案。(這個我還不太懂是照什麼順序，似乎不是照字母排) PCLZIP_OPT_EXTRACT_AS_STRING &#8211; &#8230; <a href="http://blog.hsin.tw/2008/php-pclzip/">繼續閱讀 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>前幾天為了要讓人上傳壓縮檔所以咕狗了一下<br />
<span id="more-28"></span><br />
然後就找到了這個<a href="http://www.phpconcept.net/pclzip/man/en/index.php" target="_blank">pclZip</a>，是一個class，所以很好使用，include檔案就可以用了。<br />
其實他也可以壓縮檔案，只是我還用不到，所以下面講的都比較有關解壓縮。</p>
<p>這是最基本的用法：</p>
<pre class="brush: php; title: ; notranslate">
  require_once('pclzip.lib.php');
  $archive = new PclZip('archive.zip');
  $archive-&gt;extract();
</pre>
<p>
這樣就可以把archive.zip這個檔案解壓縮到當前目錄！傷當的簡單阿！<br />
不過記得解壓縮到的目錄的權限要可以寫入，不然會卡住，我因為這個卡很久阿&#8230;很笨=..=</p>
<p>他每個method還可以加上許多的參數，可以讓壓縮檔更帥&#8230;(什麼鬼)<br />
下面是我把官網上有寫的參數都翻一下，<a href="http://www.phpconcept.net/pclzip/man/en/index.php?options" target="_blank">細節可以自己到這裡研究看看</a></p>
<table style="font-size:12px;" width="550" border=1 cellspacing=1 cellpadding=3 bgcolor="#6e6e6e">
<tr bgcolor="#dedede">
<th width="200">參數</th>
<th width="200">引數</th>
</tr>
<tr bgcolor="#dedede">
<th width="400" colspan="2">說明</th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_PATH</td>
<td>字串</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
      要解壓縮到哪的路徑。可用於extract()、extractByIndex()。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_ADD_PATH</td>
<td>字串</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
      增加一個目錄。可用於create()、add()、extract()。(使用於create()時，是把要壓縮的檔案放進這個目錄中再壓縮，使用於extract()時，是在要解壓縮的路徑中增加此目錄，並解壓縮到此目錄中)。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_REMOVE_PATH</td>
<td>字串</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
移除部份的目錄路徑，例如原本檔案所在的目錄為aa/bb/cc/test.test.txt，但是希望壓縮或解壓縮後的路徑為cc/test.txt，就可以使用PCLZIP_OPT_REMOVE_PATH,"aa/bb"。可用於create()、add()、extract()、extractByIndex()。(與PCLZIP_OPT_REMOVE_ALL_PATH一起用的時候會被自動忽略)
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_REMOVE_ALL_PATH</td>
<td>&#8211;</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
移除所有檔案的目錄，所有檔案都會被解壓縮或壓縮到當前或是指定的目錄中，請注意如果有不同目錄的相同名稱檔案，使用此參數時會被覆蓋，此參數不需要引數。可用於create()、add()、extract()、extractByIndex()。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_SET_CHMOD</td>
<td>CHMOD值</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
設定解壓縮出來的檔案的CHMOD值。可用於extract()、extractByIndex()。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_BY_NAME</td>
<td>檔案名稱</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
僅解壓縮引數中所指定的檔案，檔案名稱可以用陣列或是逗號隔開表示。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_BY_EREG</td>
<td>RegEx字串</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
僅解壓縮引數中正規表達式比對檔名正確的檔案，使用php中的ereg()函式比對。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_BY_PREG</td>
<td>RegEx字串</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
僅解壓縮引數中正規表達式比對檔名正確的檔案，使用php中的preg_match()函式比對。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_BY_INDEX</td>
<td>陣列</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
僅解壓縮引數陣列中各元素所指定順序的檔案。(這個我還不太懂是照什麼順序，似乎不是照字母排)
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_EXTRACT_AS_STRING</td>
<td>&#8211;</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
將一個檔案的內容解壓縮成一個字串，通常可能用於只需要看readme檔案的情況。請注意如果一次解壓縮太多檔案，有可能會將記憶體耗盡。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_EXTRACT_IN_OUTPUT</td>
<td>&#8211;</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
將一個檔案的內容解壓縮並直接輸出(即類似直接echo此結果)。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_NO_COMPRESSION</td>
<td>&#8211;</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
將一個檔案加入此壓縮檔內，此檔案不會被壓縮，僅是放入同一個壓縮檔中。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_COMMENT</td>
<td>字串</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
建立壓縮檔時增加一個註解，如果原本已經有註解的話，將會直接覆蓋過去。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_ADD_COMMENT</td>
<td>字串</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
建立壓縮檔時增加一個註解，如果原本已經有註解的話，將會接在後面。
    </td>
</tr>
<tr bgcolor="#dedede">
<th colspan="2"></th>
</tr>
<tr bgcolor="#ffffff">
<td>PCLZIP_OPT_PREPEND_COMMENT</td>
<td>字串</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
建立壓縮檔時增加一個註解，如果原本已經有註解的話，將會把原先的註解接在此字串的後面。
    </td>
</tr>
</table>
<p>
下面這些是範例，其實就跟官網的user manual內容一樣：</p>
<pre class="brush: php; title: ; notranslate">
//解壓縮到extract/folder/這個目錄中
$list = $archive-&gt;extract(PCLZIP_OPT_PATH, &quot;extract/folder/&quot;);

//增加這個目錄在壓縮檔中，完成以後壓縮檔裡面會有backup這個目錄，backup裡面會有這兩個檔案
$list = $archive-&gt;create(&quot;file.txt,image.gif&quot;,PCLZIP_OPT_ADD_PATH, &quot;backup&quot;);

//去掉部份的路徑，這裡完成後會變成test/file.txt
$list = $archive-&gt;add(&quot;/usr/local/user/test/file.txt&quot;,PCLZIP_OPT_REMOVE_PATH, &quot;/usr/local/user&quot;);

//把所有路徑都去掉，這個壓縮檔建立完後，裡面就只會有file.txt跟image.gif，不會有目錄了
$list = $archive-&gt;create(&quot;data/file.txt images/image.gif&quot;,PCLZIP_OPT_REMOVE_ALL_PATH);

//把解壓縮出來的檔案的CHMOD設成0777
$list = $archive-&gt;extract(PCLZIP_OPT_SET_CHMOD, 0777);

//解壓縮部份的檔案，這個參數是使用檔案名稱判別
//引數可以用下面這樣的陣列
$rule_list[0] = 'test/aaa.txt';
$rule_list[1] = 'test/ddd.txt';
//或是下面這樣，一個字串中，用逗號分隔每個要解壓縮的檔案
$rule_list = &quot;test/aaa.txt,test/ddd.txt&quot;;
$list = $archive-&gt;extract(PCLZIP_OPT_BY_NAME,$rule_list);

//解壓縮部份的檔案，使用php的ereg()函式，檔案名稱有比對成功的都會被解壓縮
$list = $archive-&gt;extract(PCLZIP_OPT_BY_EREG, &quot;aa&quot;);

//解壓縮部份的檔案，使用php的preg_match()函式，檔案名稱有比對成功的都會被解壓縮
$list = $archive-&gt;extract(PCLZIP_OPT_BY_PREG, &quot;/^bb/&quot;);
//上面這兩個函式如果不懂的話，請先研究正規表示法(Regular Expression)

//依照陣列中元素的索引解壓縮，可是我不太懂index啥 = =a
$list = $archive-&gt;extract(PCLZIP_OPT_BY_INDEX, array('0-1','6-7'));

//將一個檔案內容解壓縮成一個字串
$list = $archive-&gt;extract(PCLZIP_OPT_BY_NAME, &quot;data/readme.txt&quot;,PCLZIP_OPT_EXTRACT_AS_STRING);

//將一個檔案內容解壓縮完後直接輸出(echo)
$list = $archive-&gt;extract(PCLZIP_OPT_BY_NAME, &quot;data/readme.txt&quot;,PCLZIP_OPT_EXTRACT_IN_OUTPUT);

//將一個檔案加入一個壓縮檔中，但不會對此檔案壓縮
$list = $archive-&gt;add(&quot;data/file.txt&quot;, PCLZIP_OPT_NO_COMPRESSION);

//對此壓縮檔增加一個註解，如果原本就有註解的話會被覆蓋掉
$list = $archive-&gt;create(&quot;data&quot;, PCLZIP_OPT_COMMENT, &quot;Add a comment&quot;);

//對此壓縮檔增加一個註解，如果原本就有註解的話會接在後面
$list = $archive-&gt;add(&quot;data&quot;, PCLZIP_OPT_ADD_COMMENT, &quot;Add a comment after the existing one&quot;);

//對此壓縮檔增加一個註解，如果原本就有註解的話會放在原本的註解前面
$list = $archive-&gt;add(&quot;data&quot;, PCLZIP_OPT_PREPEND_COMMENT, &quot;Add a comment before the existing one&quot;);
</pre>
<p>這個是官網中extract()的範例：</p>
<pre class="brush: php; title: ; notranslate">
  include('pclzip.lib.php');
  $archive = new PclZip('archive.zip');
  if ($archive-&gt;extract(PCLZIP_OPT_PATH, 'data',
                        PCLZIP_OPT_REMOVE_PATH, 'install/release') == 0) {
    //當有錯誤的時候，可以用這個顯示錯誤訊息
    die(&quot;Error : &quot;.$archive-&gt;errorInfo(true));
  }
</pre>
<p>就我剛剛的研究，目前還不行建立有密碼的壓縮檔<br />
不過還是很夠用了～ 推～</p>
<p>參考資訊：<br />
<a href="http://www.phpconcept.net/pclzip/man/en/index.php" target="_blank">PclZip</a> <br />
<a href="http://support.oss.org.tw/?q=node/147" target="_blank">PclZip 簡介與使用</a> <br />
<a href="http://wiki.oss.org.tw/index.php/Php_pclzip_1" target="_blank">TechWiki:PclZip</a> </p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2008/php-pclzip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

