<?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>凸凹 &#187; PHP</title>
	<atom:link href="http://dekoboko.org/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://dekoboko.org</link>
	<description>なんという作りかけ放置プレイ！</description>
	<lastBuildDate>Fri, 30 Dec 2011 14:53:25 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>東電が「電気予報」始めたぽいのでAPI作ってみた。</title>
		<link>http://dekoboko.org/php/toden-api.html</link>
		<comments>http://dekoboko.org/php/toden-api.html#comments</comments>
		<pubDate>Wed, 01 Jun 2011 03:43:16 +0000</pubDate>
		<dc:creator>Poyosi</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[API]]></category>

		<guid isPermaLink="false">http://dekoboko.org/?p=388</guid>
		<description><![CDATA[東電が「電気予報」始めたぽいのでCSVデータを扱いやすくしてみました。 使用電力や電気予報を教えてくれるTwitterBotよろしければ、フォローください。 @denden_bot 東京電力のCSV仕様が7月1日より変更 [...]]]></description>
			<content:encoded><![CDATA[<p>東電が「電気予報」始めたぽいのでCSVデータを扱いやすくしてみました。</p>
<p>使用電力や電気予報を教えてくれるTwitterBotよろしければ、フォローください。<br />
 <a href="http://twitter.com/#!/denden_bot" target="_blank">@denden_bot</a></p>
<div style="background: #fff0f0; border: 1px solid #f07878; color: #e60000;padding:14px;margin-bottom:20px;">東京電力のCSV仕様が7月1日より変更される可能性があるため、7月1日以降一時的に以下APIが使用できなくなる恐れがありますのでご注意ください。</div>
<h3>東電 &#8211; 電気予報API</h3>
<p style="padding: 5px 10px;border: 1px solid #999; background: #eee;">API：<a href="http://toden.ozi.cc/list.json" target="_blank">http://toden.ozi.cc/list.json</a></p>
<p>予報日：pre_date</p>
<p>ピーク時供給力(万kW)カンマあり：peak<br />
ピーク時供給力(万kW)カンマなし：peak_int<br />
時間帯（自）開始：peak_time_start<br />
時間帯（至）終了：peak_time_end<br />
供給力情報更新日：peak_updated_date<br />
供給力情報更新時刻：peak_updated_time</p>
<p>予想最大電力(万kW)カンマあり：capacity<br />
予想最大電力(万kW)カンマなし：capacity_int<br />
時間帯（自）開始：capacity_time_start<br />
時間帯（至）終了：capacity_time_end<br />
予想最大電力情報更新日：capacity_updated_date<br />
予想最大電力情報更新時刻：capacity_updated_time</p>
<p>明日の予想電力使用率：peak_capacity_per</p>
<h3>使い方</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//使い方</span>
<span style="color: #000088;">$getUrl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://toden.ozi.cc/list.json&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$json</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$getUrl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$toden</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$json</span> <span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$toden</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pre_date'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;のピーク時供給力は&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$toden</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'peak'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;万kWです。&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>関連情報</h3>
<p>■東電が「電気予報」開始　毎日午後６時に更新 — スポニチ Sponichi Annex 社会<br />
<a href="http://www.sponichi.co.jp/society/news/2011/05/31/kiji/K20110531000933540.html" target="_blank">http://www.sponichi.co.jp/society/news/2011/05/31/kiji/K20110531000933540.html</a></p>
<p>■東電が「電気予報」、翌日の最大需要ＨＰに掲載 | YOMIURI ONLINE（読売新聞）<br />
<a href="http://www.yomiuri.co.jp/atmoney/news/20110531-OYT1T00904.htm" target="_blank">http://www.yomiuri.co.jp/atmoney/news/20110531-OYT1T00904.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dekoboko.org/php/toden-api.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【祝！iPad発売】iPhone・iPod Touch・iPadをPHPで判定して分岐</title>
		<link>http://dekoboko.org/apple/ipad-iphone-ipod-touch-php.html</link>
		<comments>http://dekoboko.org/apple/ipad-iphone-ipod-touch-php.html#comments</comments>
		<pubDate>Fri, 28 May 2010 02:09:32 +0000</pubDate>
		<dc:creator>Poyosi</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://dekoboko.org/?p=197</guid>
		<description><![CDATA[PC・iPhoneとiPod Touch・iPadにてアクセスされた端末によって、一つのソースで対応する方法ではなくサーバーサイドで完全にHTML切り分けて表示する方法です。 1 2 3 4 5 6 7 8 9 10 1 [...]]]></description>
			<content:encoded><![CDATA[<p>PC・iPhoneとiPod Touch・iPadにてアクセスされた端末によって、一つのソースで対応する方法ではなくサーバーサイドで完全にHTML切り分けて表示する方法です。</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;">&lt;?</span> php
<span style="color: #000088;">$ua</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">ereg</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iPhone&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$ua</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">ereg</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iPod&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$ua</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">//iPhone・iPod Touchの場合の処理</span>
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iPhoneかiPod Touchですね。&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'iphone.html'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">ereg</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iPad&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$ua</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">//iPadの場合の処理</span>
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iPadですね。&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ipad.html'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">//それ以外の場合の処理</span>
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;それ以外のブラウザですね。&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'other.html'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Webデザイナーがおすすめする初心者でもよく分かるPHPの参考書</p>
<div style="width: 100%;overflow: hidden;">
<div style="float: left;margin-right: 20px;">
<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=dekoboko0d-22&#038;o=9&#038;p=8&#038;l=as1&#038;asins=4839933146&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float: left;margin-right: 20px;">
<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=dekoboko0d-22&#038;o=9&#038;p=8&#038;l=as1&#038;asins=4798114383&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float: left;margin-right: 20px;">
<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=dekoboko0d-22&#038;o=9&#038;p=8&#038;l=as1&#038;asins=4798119865&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://dekoboko.org/apple/ipad-iphone-ipod-touch-php.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; サーバーで現在地のフルパスが知りたい。</title>
		<link>http://dekoboko.org/web/full-path.html</link>
		<comments>http://dekoboko.org/web/full-path.html#comments</comments>
		<pubDate>Mon, 19 Oct 2009 11:22:29 +0000</pubDate>
		<dc:creator>Poyosi</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://dekoboko.org/?p=155</guid>
		<description><![CDATA[仕様の分からないレンタルサーバーなどでルートからのフルパスを取りたいときに便利。 適当にpath.phpなどで保存して、アクセスすればOKです。 1 2 3 4 &#60;?php $path = realpath&#40 [...]]]></description>
			<content:encoded><![CDATA[<p>仕様の分からないレンタルサーバーなどでルートからのフルパスを取りたいときに便利。<br />
適当にpath.phpなどで保存して、アクセスすればOKです。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$path</span> <span style="color: #339933;">=</span> <span style="color: #990000;">realpath</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;.&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;絶対パス：&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$path</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://dekoboko.org/web/full-path.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone・iPod TouchをPHPで判定して分岐</title>
		<link>http://dekoboko.org/apple/iphone-ipod-touch-php.html</link>
		<comments>http://dekoboko.org/apple/iphone-ipod-touch-php.html#comments</comments>
		<pubDate>Wed, 19 Aug 2009 16:34:29 +0000</pubDate>
		<dc:creator>Poyosi</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://dekoboko.org/wp/?p=69</guid>
		<description><![CDATA[通常、iPhoneやiPod TouchでWebサイトを見る場合、文字とか画像とか小さく縮小されて表示されます。 iPhoneで見たときだけiPhone用にCSSあてたりして表示させる方法もあるんだけど、俺は、それが中途 [...]]]></description>
			<content:encoded><![CDATA[<p>通常、iPhoneやiPod TouchでWebサイトを見る場合、文字とか画像とか小さく縮小されて表示されます。<br />
iPhoneで見たときだけiPhone用にCSSあてたりして表示させる方法もあるんだけど、俺は、それが中途半端でな感じがして嫌なんで、iPhone専用に表示されるようにちゃんと切り分けたいなーと思ってます。<br />
んで、Javascriptとかで分岐するとソースが、アレな感じになるのが気持ち悪いので、サーバーサイドで判定させて分岐させることにした。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> php
<span style="color: #000088;">$ua</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">ereg</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iPhone&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$ua</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">ereg</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iPod&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$ua</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">//iPhone・iPod Touchの場合の処理</span>
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iPhoneかiPod Touchですね。&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'iphone.html'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">//それ以外の場合の処理</span>
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;それ以外のブラウザですね。&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'other.html'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Webデザイナーがおすすめする初心者でもよく分かるPHPの参考書</p>
<div style="width: 100%;overflow: hidden;">
<div style="float: left;margin-right: 20px;">
<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=dekoboko0d-22&#038;o=9&#038;p=8&#038;l=as1&#038;asins=4839933146&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float: left;margin-right: 20px;">
<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=dekoboko0d-22&#038;o=9&#038;p=8&#038;l=as1&#038;asins=4798114383&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float: left;margin-right: 20px;">
<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=dekoboko0d-22&#038;o=9&#038;p=8&#038;l=as1&#038;asins=4798119865&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://dekoboko.org/apple/iphone-ipod-touch-php.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【WordPress】コメントフォームからログアウトできない</title>
		<link>http://dekoboko.org/wordpress/comment-form-logout.html</link>
		<comments>http://dekoboko.org/wordpress/comment-form-logout.html#comments</comments>
		<pubDate>Fri, 15 May 2009 09:14:54 +0000</pubDate>
		<dc:creator>Poyosi</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://dekoboko.org/wp/?p=78</guid>
		<description><![CDATA[ログイン時、ポストのコメントフォームからログアウトしようとしても「再試行してください」というメッセージが出てログアウトできないことに気づいた。 調べてみたらバージョン2.7からは/wp-login.php?action= [...]]]></description>
			<content:encoded><![CDATA[<p>ログイン時、ポストのコメントフォームからログアウトしようとしても「再試行してください」というメッセージが出てログアウトできないことに気づいた。<br />
調べてみたらバージョン2.7からは/wp-login.php?action=logoutというログアウト用のURL（？）が使えなくなったのだそう。<br />
その変わりwp_logout_urlというnonce（ランダムな文字列を含む）なURLを吐くテンプレートタグが使えるようになってるみたいです。<br />
テーマによっては他のとこにも使われてたりするようなので書き変えとくといいかな。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">/</span>wp<span style="color: #339933;">-</span>login<span style="color: #339933;">.</span>php?action<span style="color: #339933;">=</span>logout</pre></td></tr></table></div>

<p>という部分を次のように書き変え。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;a title=&quot;Logout&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_logout_url<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Logout&lt;/a&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://dekoboko.org/wordpress/comment-form-logout.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

