<?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>Yaron's Blog &#187; PDT应用</title>
	<atom:link href="http://yaron.org.cn/archives/category/software/php-eclipse-pdt/feed" rel="self" type="application/rss+xml" />
	<link>http://yaron.org.cn</link>
	<description>About PHP MYSQL JS WEB FreeBSD etc.</description>
	<lastBuildDate>Sat, 31 Jul 2010 13:54:50 +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>PHP/MySQL 基础知识集锦一</title>
		<link>http://yaron.org.cn/archives/179</link>
		<comments>http://yaron.org.cn/archives/179#comments</comments>
		<pubDate>Wed, 16 Dec 2009 08:17:00 +0000</pubDate>
		<dc:creator>Yaron</dc:creator>
				<category><![CDATA[MySQL基础知识]]></category>
		<category><![CDATA[PDT应用]]></category>
		<category><![CDATA[PHP编程基础知识]]></category>

		<guid isPermaLink="false">http://yaron.org.cn/archives/179</guid>
		<description><![CDATA[1&#160; MySQL中把null值转换为0的函数？




1&#160; 
select&#160;ifnull(null,0);



2&#160; PHP 过滤Win系统文件名中的非法字符
 





1&#160; 
&#60;?php


2&#160; 
$this-&#62;media_planning_name&#160;=&#160;str_replace(array(&#8216;/&#8216;,&#8216;\\&#8216;,&#8216;:&#8216;,&#8216;*&#8216;,&#8216;?&#8216;,&#8216;&#34;&#8216;,&#8216;&#60;&#8216;,&#8216;&#62;&#8216;,&#8216;&#124;&#8216;),&#8216;_&#8216;,&#160;trim($media_planning_name));


3&#160; 
?&#62;



3&#160; 遍历两个日期间的日期      比如，要遍历出2009-2-10，到2009-3-30 之间的日期




1&#160; 
&#60;?php&#160;for($i&#160;=&#160;$media_planning_start_date;&#160;$i&#60;=&#160;$media_planning_end_date;&#160;$i&#160;=&#160;date(&#8216;Y-m-d&#8216;,strtotime(&#34;+1&#160;days&#160;&#34;.$i))):?&#62;


2&#160; 
&#60;?php&#160;&#160;echo&#160;$i;&#160;?&#62;


3&#160; 
&#60;?php&#160;endfor;?&#62;



4&#160;<a href="http://yaron.org.cn/archives/179" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><strong>1&#160; MySQL中把null值转换为0的函数？</strong></p>
<div style="font-size: 12px; line-height: 12px; font-family: courier new">
<table style="border-top-width: 0px; padding-right: 0px; padding-left: 0px; border-left-width: 0px; border-bottom-width: 0px; padding-bottom: 0px; width: 100%; padding-top: 0px; border-right-width: 0px" cellspacing="0">
<tbody>
<tr>
<td style="color: teal" valign="top" width="23">1&#160; </td>
<td width="871"><b><span style="color: #0000ff">select</span></b><span style="color: #000000">&#160;</span><span style="color: #000000">ifnull</span><span style="color: #ff0000">(</span><b><span style="color: #0000ff">null</span></b><span style="color: #ff0000">,</span><b><span style="color: #008080">0</span></b><span style="color: #ff0000">)</span><span style="color: #ff0000">;</span></td>
</tr>
</tbody>
</table></div>
<p><strong>2&#160; PHP 过滤Win系统文件名中的非法字符</strong></p>
<p> <span id="more-179"></span>
<p><strong></strong></p>
<div style="font-size: 12px; line-height: 12px; font-family: courier new">
<table style="border-top-width: 0px; padding-right: 0px; padding-left: 0px; border-left-width: 0px; border-bottom-width: 0px; padding-bottom: 0px; width: 100%; padding-top: 0px; border-right-width: 0px" cellspacing="0">
<tbody>
<tr>
<td style="color: teal" valign="top">1&#160; </td>
<td><span style="color: #000000; background-color: #ffff00">&lt;?</span><span style="color: #000000">php</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">2&#160; </td>
<td><b><span style="color: #ff00ff">$this</span></b><span style="color: #ff0000">-</span><span style="color: #ff0000">&gt;</span><span style="color: #000000">media_planning_name</span><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #00008b">str_replace</span></b><span style="color: #000000">(</span><b><span style="color: #00008b">array</span></b><span style="color: #000000">(</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">/</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">\\</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">:</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">*</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">?</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">&quot;</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">&lt;</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">&gt;</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">|</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">)</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">_</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #000000">&#160;</span><b><span style="color: #00008b">trim</span></b><span style="color: #000000">(</span><b><span style="color: #ff00ff">$media_planning_name</span></b><span style="color: #000000">)</span><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">3&#160; </td>
<td><span style="color: #000000; background-color: #ffff00">?&gt;</span></td>
</tr>
</tbody>
</table></div>
<p><strong>3&#160; 遍历两个日期间的日期      <br /></strong>比如，要遍历出2009-2-10，到2009-3-30 之间的日期</p>
<div style="font-size: 12px; line-height: 12px; font-family: courier new">
<table style="border-top-width: 0px; padding-right: 0px; padding-left: 0px; border-left-width: 0px; border-bottom-width: 0px; padding-bottom: 0px; width: 100%; padding-top: 0px; border-right-width: 0px" cellspacing="0">
<tbody>
<tr>
<td style="color: teal" valign="top">1&#160; </td>
<td><span style="color: #000000; background-color: #ffff00">&lt;?</span><span style="color: #000000">php</span><span style="color: #000000">&#160;</span><b><span style="color: #0000ff">for</span></b><span style="color: #000000">(</span><b><span style="color: #ff00ff">$i</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$media_planning_start_date</span></b><span style="color: #000000">;</span><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$i</span></b><span style="color: #ff0000">&lt;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$media_planning_end_date</span></b><span style="color: #000000">;</span><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$i</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #00008b">date</span></b><span style="color: #000000">(</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">Y-m-d</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,strtotime</span><span style="color: #000000">(</span><span style="color: #4682b4">&quot;</span><span style="color: #4682b4">+1</span><span style="color: #4682b4">&#160;</span><span style="color: #4682b4">days</span><span style="color: #4682b4">&#160;</span><span style="color: #4682b4">&quot;</span><span style="color: #ff0000">.</span><b><span style="color: #ff00ff">$i</span></b><span style="color: #000000">)</span><span style="color: #000000">)</span><span style="color: #000000">)</span><span style="color: #000000">:</span><span style="color: #000000; background-color: #ffff00">?&gt;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">2&#160; </td>
<td><span style="color: #000000; background-color: #ffff00">&lt;?</span><span style="color: #000000">php</span><span style="color: #000000">&#160;</span><span style="color: #000000">&#160;</span><b><span style="color: #0000ff">echo</span></b><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$i</span></b><span style="color: #000000">;</span><span style="color: #000000">&#160;</span><span style="color: #000000; background-color: #ffff00">?&gt;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">3&#160; </td>
<td><span style="color: #000000; background-color: #ffff00">&lt;?</span><span style="color: #000000">php</span><span style="color: #000000">&#160;</span><span style="color: #000000">endfor;</span><span style="color: #000000; background-color: #ffff00">?&gt;</span></td>
</tr>
</tbody>
</table></div>
<p><strong>4&#160; 在Eclipse Xdebug调试中，查看$this-&gt;account_id 的值      <br /></strong>$this     <br />&#8211;varHolder     <br />&#8212;-parameters     <br />查看所有参数：     <br />$this     <br />&#8211;requestParameters</p>
<p><strong>5&#160; 文件下载：</strong></p>
<div style="font-size: 12px; line-height: 12px; font-family: courier new">
<table style="border-top-width: 0px; padding-right: 0px; padding-left: 0px; border-left-width: 0px; border-bottom-width: 0px; padding-bottom: 0px; width: 100%; padding-top: 0px; border-right-width: 0px" cellspacing="0">
<tbody>
<tr>
<td style="color: teal" valign="top">1&#160; </td>
<td><span style="color: #000000; background-color: #ffff00">&lt;?</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">2&#160; </td>
<td><b><span style="color: #ff00ff">$report_file</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">http://</span><span style="color: #4682b4">&#8216;</span><span style="color: #ff0000">.</span><b><span style="color: #ff00ff">$this</span></b><span style="color: #ff0000">-</span><span style="color: #ff0000">&gt;</span><span style="color: #000000">getRequest</span><span style="color: #000000">(</span><span style="color: #000000">)</span><span style="color: #ff0000">-</span><span style="color: #ff0000">&gt;</span><span style="color: #000000">getHost</span><span style="color: #000000">(</span><span style="color: #000000">)</span><span style="color: #ff0000">.</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">/</span><span style="color: #4682b4">&#8216;</span><span style="color: #ff0000">.</span><span style="color: #000000">sfConfig::get</span><span style="color: #000000">(</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">sf_reports_dir</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">)</span><span style="color: #ff0000">.</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">/</span><span style="color: #4682b4">&#8216;</span><span style="color: #ff0000">.</span><b><span style="color: #ff00ff">$report</span></b><span style="color: #ff0000">-</span><span style="color: #ff0000">&gt;</span><span style="color: #000000">getReportPath</span><span style="color: #000000">(</span><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">3&#160; </td>
<td><b><span style="color: #ff00ff">$FileParts</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><span style="color: #000000">pathinfo</span><span style="color: #000000">(</span><b><span style="color: #ff00ff">$report_file</span></b><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">4&#160; </td>
<td><b><span style="color: #ff00ff">$FileName</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$FileParts</span></b><span style="color: #000000">[</span><span style="color: #4682b4">'</span><span style="color: #4682b4">basename</span><span style="color: #4682b4">'</span><span style="color: #000000">]</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">5&#160; </td>
<td><span style="color: #008000">//</span><span style="color: #008000">文件扩展名</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">6&#160; </td>
<td><b><span style="color: #0000ff">if</span></b><span style="color: #000000">&#160;</span><span style="color: #000000">(</span><b><span style="color: #00008b">isset</span></b><span style="color: #000000">(</span><b><span style="color: #ff00ff">$FileParts</span></b><span style="color: #000000">[</span><span style="color: #4682b4">'</span><span style="color: #4682b4">extension</span><span style="color: #4682b4">'</span><span style="color: #000000">]</span><span style="color: #000000">)</span><span style="color: #000000">)</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">7&#160; </td>
<td><span style="color: #000000">{</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">8&#160; </td>
<td><b><span style="color: #ff00ff">$Ream</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$FileParts</span></b><span style="color: #000000">[</span><span style="color: #4682b4">'</span><span style="color: #4682b4">extension</span><span style="color: #4682b4">'</span><span style="color: #000000">]</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">9&#160; </td>
<td><b><span style="color: #00008b">header</span></b><span style="color: #000000">(</span><span style="color: #000000">&#160;</span><span style="color: #4682b4">&quot;</span><span style="color: #4682b4">Content-Type:</span><span style="color: #4682b4">&#160;</span><span style="color: #4682b4">application/x-</span><span style="color: #4682b4">&quot;</span><span style="color: #ff0000">.</span><b><span style="color: #ff00ff">$Ream</span></b><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">10&#160; </td>
<td><b><span style="color: #00008b">header</span></b><span style="color: #000000">(</span><span style="color: #000000">&#160;</span><span style="color: #4682b4">&quot;</span><span style="color: #4682b4">Content-Disposition:</span><span style="color: #4682b4">&#160;</span><span style="color: #4682b4">attachment;</span><span style="color: #4682b4">&#160;</span><span style="color: #4682b4">filename=</span><span style="color: #4682b4">&quot;</span><span style="color: #ff0000">.</span><b><span style="color: #ff00ff">$FileName</span></b><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">11&#160; </td>
<td><span style="color: #ff0000">@</span><b><span style="color: #00008b">readfile</span></b><span style="color: #000000">(</span><b><span style="color: #ff00ff">$report_file</span></b><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">12&#160; </td>
<td><b><span style="color: #00008b">exit</span></b><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">13&#160; </td>
<td><span style="color: #000000">}</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">14&#160; </td>
<td><b><span style="color: #00008b">header</span></b><span style="color: #000000">(</span><span style="color: #000000">&#160;</span><span style="color: #4682b4">&quot;</span><span style="color: #4682b4">Content-Type:</span><span style="color: #4682b4">&#160;</span><span style="color: #4682b4">application/x-unknown</span><span style="color: #4682b4">&quot;</span><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">15&#160; </td>
<td><b><span style="color: #00008b">header</span></b><span style="color: #000000">(</span><span style="color: #000000">&#160;</span><span style="color: #4682b4">&quot;</span><span style="color: #4682b4">Content-Disposition:</span><span style="color: #4682b4">&#160;</span><span style="color: #4682b4">attachment;</span><span style="color: #4682b4">&#160;</span><span style="color: #4682b4">filename=</span><span style="color: #4682b4">&quot;</span><span style="color: #ff0000">.</span><b><span style="color: #ff00ff">$FileName</span></b><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">16&#160; </td>
<td><span style="color: #ff0000">@</span><b><span style="color: #00008b">readfile</span></b><span style="color: #000000">(</span><b><span style="color: #ff00ff">$report_file</span></b><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">17&#160; </td>
<td><b><span style="color: #00008b">exit</span></b><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top">18&#160; </td>
<td><span style="color: #000000; background-color: #ffff00">?&gt;</span></td>
</tr>
</tbody>
</table></div>
<p><strong>6&#160; 数组转换成字符串</strong></p>
<div style="font-size: 12px; line-height: 12px; font-family: courier new">
<table style="border-top-width: 0px; padding-right: 0px; padding-left: 0px; border-left-width: 0px; border-bottom-width: 0px; padding-bottom: 0px; width: 100%; padding-top: 0px; border-right-width: 0px" cellspacing="0">
<tbody>
<tr>
<td style="color: teal" valign="top" width="27">1&#160; </td>
<td width="866"><span style="color: #000000; background-color: #ffff00">&lt;?</span><span style="color: #000000">php</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="27">2&#160; </td>
<td width="866"><span style="color: #008000">//</span><span style="color: #008000">涉及函数：implode()</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="27">3&#160; </td>
<td width="866"><b><span style="color: #ff00ff">$array</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #00008b">array</span></b><span style="color: #000000">(</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">last</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">email</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">phone</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="27">4&#160; </td>
<td width="866"><b><span style="color: #ff00ff">$str_array</span></b><span style="color: #000000">&#160;</span><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #00008b">implode</span></b><span style="color: #000000">(</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">,</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$array</span></b><span style="color: #000000">)</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="27">5&#160; </td>
<td width="866"><span style="color: #008000">//</span><span style="color: #008000">&#160;</span><span style="color: #008000">last,email,phone</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="27">6&#160; </td>
<td width="866"><span style="color: #000000; background-color: #ffff00">?&gt;</span></td>
</tr>
</tbody>
</table></div>
<p>另外一种实现方法，Join函数</p>
<div style="font-size: 12px; line-height: 12px; font-family: courier new">
<table style="border-top-width: 0px; padding-right: 0px; padding-left: 0px; border-left-width: 0px; border-bottom-width: 0px; padding-bottom: 0px; width: 100%; padding-top: 0px; border-right-width: 0px" cellspacing="0">
<tbody>
<tr>
<td style="color: teal" valign="top" width="26">1&#160; </td>
<td width="867"><span style="color: #000000; background-color: #ffff00">&lt;?</span><span style="color: #000000">php</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="26">2&#160; </td>
<td width="867"><span style="color: #008000">//</span><span style="color: #008000">&#160;</span><span style="color: #008000">Function</span><span style="color: #008000">&#160;</span><span style="color: #008000">join()</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="26">3&#160; </td>
<td width="867"><b><span style="color: #ff00ff">$array</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #00008b">array</span></b><span style="color: #000000">(</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">lastname</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #000000">&#160;</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">email</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">,</span><span style="color: #000000">&#160;</span><span style="color: #4682b4">&#8216;</span><span style="color: #4682b4">phone</span><span style="color: #4682b4">&#8216;</span><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="26">4&#160; </td>
<td width="867"><b><span style="color: #ff00ff">$comma_separated</span></b><span style="color: #000000">&#160;</span><span style="color: #ff0000">=</span><span style="color: #000000">&#160;</span><b><span style="color: #00008b">join</span></b><span style="color: #000000">(</span><span style="color: #4682b4">&quot;</span><span style="color: #4682b4">,</span><span style="color: #4682b4">&quot;</span><span style="color: #000000">,</span><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$array</span></b><span style="color: #000000">)</span><span style="color: #000000">;</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="26">5&#160; </td>
<td width="867"><b><span style="color: #0000ff">echo</span></b><span style="color: #000000">&#160;</span><b><span style="color: #ff00ff">$comma_separated</span></b><span style="color: #000000">;</span><span style="color: #000000">&#160;</span><span style="color: #008000">//</span><span style="color: #008000">&#160;</span><span style="color: #008000">lastname,email,phone</span></td>
</tr>
<tr>
<td style="color: teal" valign="top" width="26">6&#160; </td>
<td width="867"><span style="color: #000000; background-color: #ffff00">?&gt;</span></td>
</tr>
</tbody>
</table></div>
]]></content:encoded>
			<wfw:commentRss>http://yaron.org.cn/archives/179/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDT中配置文件编码</title>
		<link>http://yaron.org.cn/archives/117</link>
		<comments>http://yaron.org.cn/archives/117#comments</comments>
		<pubDate>Mon, 23 Mar 2009 02:39:40 +0000</pubDate>
		<dc:creator>Yaron</dc:creator>
				<category><![CDATA[PDT应用]]></category>

		<guid isPermaLink="false">http://yaron.org.cn/archives/117</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160; 在使用PDT进行PHP开发时，难免会遇到文件编码的问题。把配置过程写下来，以加深印象。
 
1&#160; 配置全局编码
&#160;&#160;&#160;&#160;&#160; 菜单Window –&#62;&#160; Preferences&#160; -&#62; General&#160; -&#62;&#160; Workspace 右边窗口 Text file encoding设置。
2&#160; PHP编码配置
&#160;&#160;&#160;&#160;&#160; PHP文件采用全局编码，无需配置。但是Debug中需要设置，建议和全局相同，否则会带来很大的麻烦。菜单Window –&#62;&#160; Preferences&#160; -&#62;<a href="http://yaron.org.cn/archives/117" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>&#160;&#160;&#160;&#160;&#160; 在使用PDT进行PHP开发时，难免会遇到文件编码的问题。把配置过程写下来，以加深印象。</p>
<p> <span id="more-117"></span><br />
<h5>1&#160; 配置全局编码</h5>
<p>&#160;&#160;&#160;&#160;&#160; 菜单Window –&gt;&#160; Preferences&#160; -&gt; General&#160; -&gt;&#160; Workspace 右边窗口 Text file encoding设置。</p>
<h5>2&#160; PHP编码配置</h5>
<p>&#160;&#160;&#160;&#160;&#160; PHP文件采用全局编码，无需配置。但是Debug中需要设置，建议和全局相同，否则会带来很大的麻烦。菜单Window –&gt;&#160; Preferences&#160; -&gt; PHP&#160; -&gt;&#160; Debug 右边窗口 Encoding Settings设置。</p>
<h5>3&#160; HTML文件编码</h5>
<p>&#160;&#160;&#160;&#160;&#160; HTML/CSS文件需要设置文件编码。菜单Window –&gt;&#160; Preferences&#160; -&gt; Web&#160; -&gt;&#160; CSS Files 右边窗口 Encoding设置。菜单Window –&gt;&#160; Preferences&#160; -&gt; Web&#160; -&gt;&#160; HTML Files 右边窗口 Encoding设置。同样，建议和全局相同，否则会带来很大的麻烦。</p>
<h5>4&#160; XML文件编码</h5>
<p>&#160;&#160;&#160;&#160;&#160; XML文件一般都是UTF-8编码，但有时也会设置为gbk等。这个需要在菜单Window –&gt;&#160; Preferences&#160; -&gt; XML&#160; -&gt;&#160; XML Files 右边窗口 Encoding设置。同样，建议和全局相同，否则会带来很大的麻烦。</p>
<h5>5&#160; JS文件编码</h5>
<p>&#160;&#160;&#160;&#160;&#160; JS文件采用全局编码，无需独立配置。</p>
<h5>6&#160; 设置单个文件编码</h5>
<p>&#160;&#160;&#160;&#160;&#160; 我们时常会从其他地方粘贴文本到PDT，如果显示乱码，很大程度就是编码问题。</p>
<p>&#160;&#160;&#160;&#160;&#160; <strong>第一种处理方法</strong>，在文件内容上击 ALT + Enter 打开该文件属性，Preperties for 对话框右下方 Text file encoding 即可设置；</p>
<p>&#160;&#160;&#160;&#160;&#160; <strong>另外一种方法就是</strong>，使用editplus等轻量级编辑器转换编码。</p>
]]></content:encoded>
			<wfw:commentRss>http://yaron.org.cn/archives/117/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
