<?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 &#8211; 任姓人妻 の 生活紀錄</title>
	<atom:link href="https://blog.cindygirl.cc/archives/category/learn/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.cindygirl.cc</link>
	<description>我是冠冠，於2015年1月1日正式成為人妻，在此紀錄婚後的點點滴滴。</description>
	<lastBuildDate>Tue, 24 Mar 2020 02:15:46 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>透過 ajax傳遞 checkbox:checked 陣列 &#038; codeigniter Controller 接值</title>
		<link>https://blog.cindygirl.cc/archives/8664/%e9%80%8f%e9%81%8e-ajax%e5%82%b3%e9%81%9e-checkboxchecked-%e9%99%a3%e5%88%97-codeigniter-controller-%e6%8e%a5%e5%80%bc/</link>
					<comments>https://blog.cindygirl.cc/archives/8664/%e9%80%8f%e9%81%8e-ajax%e5%82%b3%e9%81%9e-checkboxchecked-%e9%99%a3%e5%88%97-codeigniter-controller-%e6%8e%a5%e5%80%bc/#respond</comments>
		
		<dc:creator><![CDATA[cindygirl]]></dc:creator>
		<pubDate>Fri, 20 Mar 2020 07:55:13 +0000</pubDate>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://blog.cindygirl.cc/?p=8664</guid>

					<description><![CDATA[<p>ajax 設定 FormData() 傳遞陣列  &#8230;</p>
<p>這篇文章 <a rel="nofollow" href="https://blog.cindygirl.cc/archives/8664/%e9%80%8f%e9%81%8e-ajax%e5%82%b3%e9%81%9e-checkboxchecked-%e9%99%a3%e5%88%97-codeigniter-controller-%e6%8e%a5%e5%80%bc/">透過 ajax傳遞 checkbox:checked 陣列 &#038; codeigniter Controller 接值</a> 最早出現於 <a rel="nofollow" href="https://blog.cindygirl.cc">任姓人妻 の 生活紀錄</a>。</p>
]]></description>
										<content:encoded><![CDATA[<h3><b>ajax 設定 FormData() 傳遞陣列</b></h3>
<blockquote>
<div>  // 1. 取得勾選項目</div>
<div>        var items = [];</div>
<div>        $.each($(&#8220;.select-export:checked&#8221;), function(){</div>
<div>            items.push($(this).val());</div>
<div>        });</div>
<div>            var form_data = new FormData();</div>
<div>            form_data.append(&#8216;ids&#8217;, items);</div>
<div></div>
<div>        // 2. 匯出</div>
<div>          $.ajax({</div>
<div>            url: &#8220;/Product/export&#8221;,</div>
<div>            type: &#8220;POST&#8221;,</div>
<div>            dataType: &#8220;text&#8221;,</div>
<div>            <span style="color: #ff0000;">data: form_data,</span></div>
<div>            contentType: false,</div>
<div>            processData: false,</div>
<div>            success: function(data) {</div>
<div></div>
<div>            },</div>
<div>            error: function(XMLHttpRequest, textStatus, errorThrown) {</div>
<div></div>
<div>            }</div>
<div>        });</div>
</blockquote>
<h3><strong>PHP Controller 接值  (use  codeigniter)</strong></h3>
<blockquote><p>$_REQUEST[&#8216;ids&#8217;];</p></blockquote>
<p>這篇文章 <a rel="nofollow" href="https://blog.cindygirl.cc/archives/8664/%e9%80%8f%e9%81%8e-ajax%e5%82%b3%e9%81%9e-checkboxchecked-%e9%99%a3%e5%88%97-codeigniter-controller-%e6%8e%a5%e5%80%bc/">透過 ajax傳遞 checkbox:checked 陣列 &#038; codeigniter Controller 接值</a> 最早出現於 <a rel="nofollow" href="https://blog.cindygirl.cc">任姓人妻 の 生活紀錄</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.cindygirl.cc/archives/8664/%e9%80%8f%e9%81%8e-ajax%e5%82%b3%e9%81%9e-checkboxchecked-%e9%99%a3%e5%88%97-codeigniter-controller-%e6%8e%a5%e5%80%bc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP匯出Excel (.xls .xlsx) ，電話/手機 第一碼0會不見</title>
		<link>https://blog.cindygirl.cc/archives/8648/php%e5%8c%af%e5%87%baexcel-xls-xlsx-%ef%bc%8c%e9%9b%bb%e8%a9%b1-%e6%89%8b%e6%a9%9f-%e7%ac%ac%e4%b8%80%e7%a2%bc0%e6%9c%83%e4%b8%8d%e8%a6%8b/</link>
					<comments>https://blog.cindygirl.cc/archives/8648/php%e5%8c%af%e5%87%baexcel-xls-xlsx-%ef%bc%8c%e9%9b%bb%e8%a9%b1-%e6%89%8b%e6%a9%9f-%e7%ac%ac%e4%b8%80%e7%a2%bc0%e6%9c%83%e4%b8%8d%e8%a6%8b/#respond</comments>
		
		<dc:creator><![CDATA[cindygirl]]></dc:creator>
		<pubDate>Fri, 06 Mar 2020 08:16:48 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[學習筆記]]></category>
		<guid isPermaLink="false">https://blog.cindygirl.cc/?p=8648</guid>

					<description><![CDATA[<p>匯出 .xls，看了前輩寫的方式是加上 等號跟雙引&#8230;</p>
<p>這篇文章 <a rel="nofollow" href="https://blog.cindygirl.cc/archives/8648/php%e5%8c%af%e5%87%baexcel-xls-xlsx-%ef%bc%8c%e9%9b%bb%e8%a9%b1-%e6%89%8b%e6%a9%9f-%e7%ac%ac%e4%b8%80%e7%a2%bc0%e6%9c%83%e4%b8%8d%e8%a6%8b/">PHP匯出Excel (.xls .xlsx) ，電話/手機 第一碼0會不見</a> 最早出現於 <a rel="nofollow" href="https://blog.cindygirl.cc">任姓人妻 の 生活紀錄</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>匯出 .xls，看了前輩寫的方式是加上 <span style="color: #ff0000;"><strong>等號跟雙引號</strong></span><br />
匯出時就能正常顯示電話號碼，0不會不見<br />
$memberPhone = <span style="color: #ff0000;">&#8216;=&#8221;&#8216;</span>.$member-&gt;phone.<span style="color: #ff0000;">&#8216;&#8221;&#8216;</span>;</p>
<p>後來改為匯出 .xlsx，發現上面的方式失效了，匯出會變成公式格式<br />
雖然點擊Excel的編輯可以正常顯示，但是如果要匯入其他介面，會讀取失敗。<br />
後來找到<a href="https://ithelp.ithome.com.tw/questions/10194852?sc=rss.qu" target="_blank" rel="noopener">其他前輩的解法</a>，加上 <span style="color: #ff0000;"><strong>\t</strong> </span>就搞定了！<br />
雖然參考的文章是針對CSV，但死馬當活馬醫，竟然也適用～<br />
$memberPhone = <span style="color: #ff0000;">&#8220;\t&#8221;</span>.$member-&gt;phone;</p>
<hr />
<p>一開始不懂 \t 的來由是啥，後來發現了<br />
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Char-Syntax.html" target="_blank" rel="noopener">原來\t 就是Tab的意思</a><br />
用Mac的Numbers打開，會發現資料前面會有一片空格<br />
但如果是用正規的Excel打開就會顯示正常～</p>
<p>這篇文章 <a rel="nofollow" href="https://blog.cindygirl.cc/archives/8648/php%e5%8c%af%e5%87%baexcel-xls-xlsx-%ef%bc%8c%e9%9b%bb%e8%a9%b1-%e6%89%8b%e6%a9%9f-%e7%ac%ac%e4%b8%80%e7%a2%bc0%e6%9c%83%e4%b8%8d%e8%a6%8b/">PHP匯出Excel (.xls .xlsx) ，電話/手機 第一碼0會不見</a> 最早出現於 <a rel="nofollow" href="https://blog.cindygirl.cc">任姓人妻 の 生活紀錄</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.cindygirl.cc/archives/8648/php%e5%8c%af%e5%87%baexcel-xls-xlsx-%ef%bc%8c%e9%9b%bb%e8%a9%b1-%e6%89%8b%e6%a9%9f-%e7%ac%ac%e4%b8%80%e7%a2%bc0%e6%9c%83%e4%b8%8d%e8%a6%8b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
