<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>MEPO Forum - PHP</title>
        <description></description>
        <link>http://mepopedia.com/forum/list.php?290</link>
        <lastBuildDate>Wed, 29 Apr 2026 15:47:17 +0800</lastBuildDate>
        <generator>Phorum 5.2.7</generator>
        <item>
            <guid>http://mepopedia.com/forum/read.php?290,23622,23622#msg-23622</guid>
            <title>[PHP] Case-insensitive in_array() funciton (without foreach) (no replies)</title>
            <link>http://mepopedia.com/forum/read.php?290,23622,23622#msg-23622</link>
            <description><![CDATA[For a case-insensitive in_array(), you can use array_map() to avoid a foreach statement, e.g.:<br />
<br />
<pre>&lt;?php
    function in_arrayi($needle, $haystack) {
        return in_array(strtolower($needle), array_map('strtolower', $haystack));
    }
?></pre>
<br />
Reference and source:<br />
1. <a href=http://us2.php.net/manual/en/function.in-array.php#89256>User Contributed Notes in PHP Manuel</a> (2009.02)<br />
2. <a href=http://stackoverflow.com/questions/2166512/php-case-insensitive-in-array-function>Q&A Discussion in Stack Overflow</a> (2010.10)]]></description>
            <dc:creator>mepoadm</dc:creator>
            <category>PHP</category>
            <pubDate>Wed, 20 Jun 2012 15:29:15 +0800</pubDate>
        </item>
        <item>
            <guid>http://mepopedia.com/forum/read.php?290,19934,19934#msg-19934</guid>
            <title>時間格式 (年月日時分秒) 轉換的函式：date() (no replies)</title>
            <link>http://mepopedia.com/forum/read.php?290,19934,19934#msg-19934</link>
            <description><![CDATA[<b>時間格式轉換的函式：date()</b><br />
<br />
語法：<br />
string date ( string $format [, int $timestamp ] )<br />
<br />
範列：<br />
echo date(&#39;&#39;m-d-Y h:i:s A&#39;, $timestamp);<br />
--> 2009-10-17 08:22:20 PM<br />
<br />
參數：<br />
<pre>
 a - "am" 或是 "pm"
 A - "AM" 或是 "PM"

 d - 幾日，二位數字，若不足二位則前面補零; 如: "01" 至 "31"
 j - 幾日，二位數字，若不足二位不補零; 如: "1" 至 "31"

 D - 星期幾，三個英文字母; 如: "Fri"
 l - 星期幾，英文全名; 如: "Friday"

 F - 月份，英文全名; 如: "January"
 M - 月份，三個英文字母; 如: "Jan"
 m - 月份，二位數字，若不足二位則在前面補零; 如: "01" 至 "12"
 n - 月份，二位數字，若不足二位則不補零; 如: "1" 至 "12"

 h - 12 小時制的小時; 如: "01" 至 "12"
 H - 24 小時制的小時; 如: "00" 至 "23"
 g - 12 小時制的小時，不足二位不補零; 如: "1" 至 12"
 G - 24 小時制的小時，不足二位不補零; 如: "0" 至 "23"

i - 分鐘; 如: "00" 至 "59"
s - 秒; 如: "00" 至 "59"
S - 字尾加英文序數，二個英文字母; 如: "th"，"nd"
t - 指定月份的天數; 如: "28" 至 "31"
U - 總秒數
w - 數字型的星期幾，如: "0" (星期日) 至 "6" (星期六)
Y - 年，四位數字; 如: "1999"
y - 年，二位數字; 如: "99"
z - 一年中的第幾天; 如: "0" 至 "365"</pre>
<br />
參數部份中文翻譯參考：http://home.ck101.com/space.php?uid=478340&do=blog&id=28706]]></description>
            <dc:creator>HP</dc:creator>
            <category>PHP</category>
            <pubDate>Thu, 02 Feb 2012 18:32:26 +0800</pubDate>
        </item>
        <item>
            <guid>http://mepopedia.com/forum/read.php?290,15715,15715#msg-15715</guid>
            <title>A Possible Solve to Cookie Issues in Google Chrome (setcookie) (no replies)</title>
            <link>http://mepopedia.com/forum/read.php?290,15715,15715#msg-15715</link>
            <description><![CDATA[A quick suggestion, if you encountered problems setting cookies in Google Chrome, is:<br />
<br />
Change your original setting for subdomains<br />
<br />
<pre style="border: gray solid 1px">
setcookie('session',      $session_key, $timeout, '/', '.domain.com' );

To

setcookie('session',      $session_key, $timeout, '/');</pre>
<br />
This could make things easier.<br />
<br />
My personal experience is, HOW YOU CREATE A COOKIE IS THE WAY YOU DELETE THE COOKIE.<br />
<br />
(If you set the cookie in NULL domain setting, you should use NULL domain to delete it.)<br />
<br />
And, use the embedded Chrome tool (<b>F12->Recources->Cookies</b>) to check your cookies. I suggest to check if the cookies are the same in www.domain.com and domain.com (or xxx.domain.com). In the cases I encountered, they were simply DIFFERENT.<br />
<br />
--<br />
<br />
My scenario is making some changes in the session/login management (for the cross-domain stuff). Originally, I use the same setcookie setting in session restore and session create, like<br />
<br />
setcookie('session',      $session_key, $timeout, '/', '.domain.com' );<br />
<br />
But, I changed the setting in session restore to<br />
<br />
setcookie('session',      $session_key, $timeout, '/')<br />
<br />
Any things go wrong after that.<br />
<br />
<br />
If my memory and interpretation are right, I guess the cookies set in NULL domain are SUPERIOR than those set in other domain settings. So once you set a cookie in NULL domain, you cannot delete/modify the cookie in other means.<br />
<br />
If you set different cookies in .domain.com and domain.com (I main NULL), only the cookie set in NULL domain takes effect in domain.com. The one set in .domain.com (only) work in www.doamin.com.<br />
<br />
So in my case, I set cookie in NULL domain in LOGIN (session create) and set in .domain.com in SESSION RESTROE. This (hoplefully) can make cookies work fine in all scenarios.]]></description>
            <dc:creator>Hsinping</dc:creator>
            <category>PHP</category>
            <pubDate>Mon, 19 Sep 2011 01:53:32 +0800</pubDate>
        </item>
        <item>
            <guid>http://mepopedia.com/forum/read.php?290,5733,5733#msg-5733</guid>
            <title>電子郵件的好工具：PHPMailer 5.1(最新版)下載 (Linux &amp; Windows) (no replies)</title>
            <link>http://mepopedia.com/forum/read.php?290,5733,5733#msg-5733</link>
            <description><![CDATA[以下連結可直接下載 PHPMailer 5.1 (for PHP5 / PHP6)。<br />
<br />
Zip files (for Windows)：<br />
<br />
https://github.com/Synchro/PHPMailer/archive/master.zip<br />
<br />
Tar ball (for Linux):<br />
http://downloads.sourceforge.net/project/phpmailer/phpmailer%20for%20php5_6/PHPMailer%20v5.1/PHPMailer_v5.1.tar.gz?use_mirror=ncu]]></description>
            <dc:creator>Hsinping</dc:creator>
            <category>PHP</category>
            <pubDate>Fri, 02 Apr 2010 20:19:44 +0800</pubDate>
        </item>
        <item>
            <guid>http://mepopedia.com/forum/read.php?290,2226,2226#msg-2226</guid>
            <title>以PHP Script查詢 IP 地址對應之相關資訊(國家、城市、ISP、Domain Name等) (no replies)</title>
            <link>http://mepopedia.com/forum/read.php?290,2226,2226#msg-2226</link>
            <description><![CDATA[把下段 PHP 程式碼加入 php script 就可以得到 IP Address 相對應的資訊。<br />
<code><br />
[PHP]<br />
　$country = file_get_contents('http://api.hostip.info/country.php?ip='.$_SERVER['REMOTE_ADDR'];<br />
　echo $country;<br />
[/PHP]<br />
</code><br />
基本原理就是以 HTTP URL (GET) 的方式<br />
<br />
http://api.hostip.info/country.php?ip=140.112.41.70<br />
<br />
取回 IP-to-Country 的資訊，再 echo 出來。<br />
<br />
(請注意：本頁介紹的作法本為以下的 PHP 程式碼，但以下利用的網址 http://www.ipmango.com/api.php 似已不能使用。 2009.11.04)<br />
<br />
<code><br />
$ip = '59.32.28.65';<br />
$url = "http://www.ipmango.com/api.php?ip=".$ip;<br />
$xml = simplexml_load_file($url);<br />
echo "IP address : {$xml->ipaddress} \n";<br />
echo "City : {$xml->city} \n";<br />
echo "Region : {$xml->region} \n";<br />
echo "Country Name : {$xml->countryname} \n";<br />
echo "Latitude : {$xml->latitude} \n";<br />
echo "Longitude : {$xml->longitude} \n";<br />
</code><br />
<br />
Reference:<br />
IP-to-Country: http://www.daniweb.com/forums/thread47999.html<br />
<a href=http://www.daniweb.com/forums/thread153705.html>PHP Script to find Visitor's Location (2008/10/27)</a>]]></description>
            <dc:creator>HP</dc:creator>
            <category>PHP</category>
            <pubDate>Sat, 17 Oct 2009 22:14:57 +0800</pubDate>
        </item>
        <item>
            <guid>http://mepopedia.com/forum/read.php?290,1347,1347#msg-1347</guid>
            <title>[推薦] 網站「日本偶像劇場」的站長 PHP 程式誌 (no replies)</title>
            <link>http://mepopedia.com/forum/read.php?290,1347,1347#msg-1347</link>
            <description><![CDATA[「<a href=http://dorama.info>日本偶像劇場</a>」算是個日劇大站，在 alexa 的排名目前(2009.08.31) 排第 27,280 名，在台灣排第 382 名。<br />
<br />
站長在該站的精華中放了他從 2001 年一路以來在 PHP 程式撰寫上所用到的工具以及一些心得，我覺得很多都非常實用，和大家分享：<br />
<br />
日本偶像劇場的精華區 PHP 誌：<a href=http://dorama.info/esc/esc.php?num=33>http://dorama.info/esc/esc.php?num=33</a><br />
<br />
<br />
整理幾個以 PHP 架站時很實用的文章：<br />
<br />
<a href=http://dorama.info/esc-1551.html>整個網站語系由 BIG5 轉成 UTF-8 (2004)</a><br />
<a href=http://dorama.info/esc-160.html>利用網頁壓縮增加頻寬 (2005)</a><br />
<a href=http://dorama.info/esc-1248.html>本站 UTF-8 的繁簡互轉 (2008)</a>]]></description>
            <dc:creator>HP</dc:creator>
            <category>PHP</category>
            <pubDate>Mon, 31 Aug 2009 02:54:58 +0800</pubDate>
        </item>
    </channel>
</rss>
