<?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://saikyoline.jp/weblog/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://saikyoline.jp/weblog</link>
	<description>コンピュータに関係あることとか、ないこととか。</description>
	<lastBuildDate>Fri, 04 May 2012 15:44:45 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHPマニュアル検索をどうぞ。</title>
		<link>http://saikyoline.jp/weblog/2012/04/04/014230.html</link>
		<comments>http://saikyoline.jp/weblog/2012/04/04/014230.html#comments</comments>
		<pubDate>Tue, 03 Apr 2012 16:42:30 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=1441</guid>
		<description><![CDATA[先日しばらくぶりにPHP、しかも4を書く機会がありました。 そこで数年前に作ったFirefox用の検索プラグイン（OpenSearch）を使いまして、まだまともに動いていたのでなんとなく公開しておきます。作った、といって [...]]]></description>
			<content:encoded><![CDATA[<p>先日しばらくぶりにPHP、しかも4を書く機会がありました。<br />
そこで数年前に作ったFirefox用の検索プラグイン（OpenSearch）を使いまして、まだまともに動いていたのでなんとなく<a href="http://saikyoline.jp/opensearch/">公開</a>しておきます。作った、といってもちょちょっとXML書いただけなんですが。</p>
<p>ともあれ、件のコードはPHP4のシステムとさよならするためのものだったので、自分はもう4系を書くことはないと思います。かといって5系を書くかどうかは別の話ですが。<br />
しかしまぁ、まだ現役で動いている4系が居たりするのでしょうね。たぶん。</p>
<p><a href="http://saikyoline.jp/opensearch/">OpenSearchプラグイン</a></p>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2012/04/04/014230.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPでファイルアップロードができない。</title>
		<link>http://saikyoline.jp/weblog/2010/07/12/235608.html</link>
		<comments>http://saikyoline.jp/weblog/2010/07/12/235608.html#comments</comments>
		<pubDate>Mon, 12 Jul 2010 14:56:08 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=1003</guid>
		<description><![CDATA[正しくは大きなファイルがアップロードできなかった。 PHP ファイルのアップロードエラー解決方法 PHP のファイルアップロード実装で、つまずきそうな部分をまとめてました。 しっかりつまずきました！ありがとうございます！]]></description>
			<content:encoded><![CDATA[<p>正しくは<strong>大きなファイル</strong>がアップロードできな<strong>かった</strong>。</p>
<blockquote cite="http://futuremix.org/2008/08/php-file-upload-problem" title="PHP ファイルのアップロードエラー解決方法"><p><a href="http://futuremix.org/2008/08/php-file-upload-problem">PHP ファイルのアップロードエラー解決方法</a></p>
<p>PHP のファイルアップロード実装で、つまずきそうな部分をまとめてました。</p></blockquote>
<p>しっかりつまずきました！ありがとうございます！</p>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2010/07/12/235608.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2つ以上引数があるPHP関数をSmarty内で使う。</title>
		<link>http://saikyoline.jp/weblog/2007/05/17/192447.html</link>
		<comments>http://saikyoline.jp/weblog/2007/05/17/192447.html#comments</comments>
		<pubDate>Thu, 17 May 2007 10:24:47 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=408</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://itpro.nikkeibp.co.jp/article/COLUMN/20070402/267111/" title="【PHP TIPS】 27. Smarty内でPHP関数を使う：ITpro"><p><a href="http://itpro.nikkeibp.co.jp/article/COLUMN/20070402/267111/">【PHP TIPS】 27. Smarty内でPHP関数を使う：ITpro</a></p>
<p>上記のように引数を持つ場合はSmarty変数が第1引数となり、第2引数以降は:で 区切って渡します。 このような使い方にはあまり遭遇しないと思いますが、頭の隅に入れておけば必 ず役に立つ日がきます！</p></blockquote>
<p>まことに不本意ながら役に立つ日がきたわけですが、この「パイプを通ってきたものは<strong>自動的に第1引数</strong>になる」ってのがくせ者で。<br/></p>
<pre class="code"><code>str_replace(&quot;b&quot;, &quot;z&quot;, $hoge);</code></pre>
<p>ってやりたくて、</p>
<pre class="code"><code>{$hoge|str_replace:&quot;b&quot;:&quot;z&quot;}</code></pre>
<p>ってすると、</p>
<pre class="code"><code>str_replace($hoge, &quot;b&quot;, &quot;z&quot;);</code></pre>
<p>ってことになる。<br/><br />
なんだこのｑあｗせｄｒｆｔｇｙふじこｌｐ；って思ってたら、エンゲル係数が高いことで有名な<a href="http://plnet.jp/kjirou/">kjirou</a>さんにこんなコメントを賜りました。<br/></p>
<blockquote><p>{&#8220;b&#8221;|str_replace:&#8221;z&#8221;:$hoge} はしたくない的な？</p></blockquote>
<p><br/><br />
あーその発想は（ｒｙ<br/><br />
できました。感覚的にはパイプを通るのはリテラルじゃなくて変数であって欲しいんだけども。<br/><br />
<br/><br />
・・・これはおれの頭が固いってことなんだろうか。</p>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2007/05/17/192447.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>file_get_contents()が使えない。</title>
		<link>http://saikyoline.jp/weblog/2007/02/16/232557.html</link>
		<comments>http://saikyoline.jp/weblog/2007/02/16/232557.html#comments</comments>
		<pubDate>Fri, 16 Feb 2007 14:25:57 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=381</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>サクッとGETしたいときに使いまくっているfile_get_contents()ですが、最近使い始めたステキなWebホスティングサービスの<a href="http://www.dreamhost.com/hosting.html">DreamHost</a>でこんなことを言われました。</p>
<pre class="code"><code>Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in ...</code></pre>
<p>はぁーン！？<br/><br />
<br/><br />
・・・ついカッとなって実装した。GETできればなんでも良かった。いまは反省している。<br/><br />
<br/><br />
詳細は以下の通り。</p>
<p><span id="more-381"></span></p>
<pre class="code"><code>function do_get($url) {
$res = get_contents($url);
$res_array = explode(&quot;\r\n&quot;, $res);

switch ($res_array[0]) { // とりあえず必要なコードのみ。
case 'HTTP/1.0 200 OK':
case 'HTTP/1.1 200 OK':
// ボディを取り出す。
$ra = explode(&quot;\r\n\r\n&quot;, $res, 2);
$res = $ra[1];
break;
case 'HTTP/1.1 302 MovedTemporarily':
// 移動先URLを取り出す。
foreach ($res_array as $res_row) {
if (strstr($res_row, 'Location: ')) {
$crr_url = str_replace('Location: ', '', $res_row);
break;
}
}
$res = get_contents($crr_url);

// ボディを取り出す。
$ra = explode(&quot;\r\n\r\n&quot;, $res, 2);
$res = $ra[1];
break;
default:
$res = '';
}

return $res;
}

function get_contents($url) {
// ホストとポートを取得する。
$url_array = parse_url($url);
$host = $url_array['host'];
$path = $url_array['path'];
if (array_key_exists('port', $url_array)) {
$port = $url_array['port'];
} else {
switch ($url_array['scheme']) {
case 'http':
$port = 80;
break;
}
}
$query = $url_array['query'];

$res = false;
if (isset($host) &amp;&amp; isset($port)) {
$fp = fsockopen($host, $port, $errno, $errstr, 30);
if ($fp) {
$req
= &quot;GET &quot; . $path . &quot;?&quot; . $query . &quot; HTTP/1.0\r\n&quot;
. &quot;Host: &quot; . $host . &quot;\r\n&quot;
. &quot;\r\n&quot;;

socket_set_timeout($fp, 10);
if (fputs($fp, $req, strlen($req))) {
$res = '';
while (!feof($fp)) {
$res .= fgets($fp);
}
}
fclose($fp);
}
}
return $res;
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2007/02/16/232557.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>file_get_contents()が投げるヘッダ。</title>
		<link>http://saikyoline.jp/weblog/2007/02/14/003028.html</link>
		<comments>http://saikyoline.jp/weblog/2007/02/14/003028.html#comments</comments>
		<pubDate>Tue, 13 Feb 2007 15:30:28 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=378</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://www.ietf.org/rfc/rfc2616.txt" title=""><p><a href="http://www.ietf.org/rfc/rfc2616.txt">Hypertext Transfer Protocol &#8212; HTTP/1.1</a></p>
<p>HTTP/1.1 defines the &#8220;close&#8221; connection option for the sender to signal that the connection will be closed after completion of the response. For example,<br/><br/>Connection: close<br/><br/>in either the request or the response header fields indicates that the connection SHOULD NOT be considered `persistent&#8217; (section 8.1) after the current request/response is complete.</p></blockquote>
<p>サクッとGETしたいときはもっぱらfile_get_contents()を使っているわけですが、HTTP/1.1では明示しないとコネクションをすぐに切られない件について話をしていて、そういえばこいつはどんなヘッダを投げているんだろうと気になったので調べてみました。</p>
<pre class="code"><code>$ php -r 'file_get_contents(&quot;http://saikyoline.jp/&quot;);'</code></pre>
<p>で、これ。</p>
<pre class="code"><code>GET / HTTP/1.0\r\n
Host: saikyoline.jp\r\n
\r\n</code></pre>
<p>なんてシンプルなんだ。そしてHTTP/1.0だ。</p>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2007/02/14/003028.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>気になるフレームワーク。</title>
		<link>http://saikyoline.jp/weblog/2006/04/16/235612.html</link>
		<comments>http://saikyoline.jp/weblog/2006/04/16/235612.html#comments</comments>
		<pubDate>Sun, 16 Apr 2006 14:56:12 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=243</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://zephyr-php.sourceforge.net/" title="Zephyr - AJAX Based MVC Framework for PHP5 Developers"><p><a href="http://zephyr-php.sourceforge.net/">Zephyr &#8211; AJAX Based MVC Framework for PHP5 Developers</a></p>
<p>zephyr is an ajax based framework for php5 developers. you can easily develop business applications using this robust framework.</p></blockquote>
<p>[via] Ajaxian » Zephyr: Ajax MVC Framework for PHP &#8211; <a href="http://ajaxian.com/archives/zephyr-ajax-mvc-framework-for-php">http://ajaxian.com/archives/zephyr-ajax-mvc-framework-for-php</a><br/><br />
<br/><br />
「<a href="http://smarty.php.net/">smarty</a>」と「<a href="http://adodb.sourceforge.net/">adoDB</a>」そして「<a href="http://prototype.conio.net/">prototype</a>」。それと「CPAINT」っての初めて知ったんですが</p>
<blockquote cite="http://cpaint.booleansystems.com/" title="CPAINT :: home"><p><a href="http://cpaint.booleansystems.com/">CPAINT :: home</a></p>
<p>CPAINT (Cross-Platform Asynchronous INterface Toolkit) is a multi-language toolkit that helps web developers design and implement AJAX web applications with ease and flexibility.</p></blockquote>
<p>ですと。<br/><br />
定義ファイルはXMLなんですな。YAMLやらJSONやらのご時世ですが。<br/><br />
で、ちょいと使ってみるか、と思ったら、coLinuxにPHP入ってねぇやと気がつく。またあらためて。</p>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2006/04/16/235612.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>addslashes()でのエスケープ。</title>
		<link>http://saikyoline.jp/weblog/2006/02/13/125523.html</link>
		<comments>http://saikyoline.jp/weblog/2006/02/13/125523.html#comments</comments>
		<pubDate>Mon, 13 Feb 2006 03:55:23 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=198</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<blockquote><p><a title="hoshikuzu | star_dust の書斎" href="http://d.hatena.ne.jp/hoshikuzu/20060211#P20060211PHPSQLINJECTION">hoshikuzu | star_dust の書斎</a></p>
<p>PHPでは、一部のマルチバイトエンコーディングにおいて、addslashes()を使っているとSQLインジェクションが発生しかねないよ、はてどうしましょう、というお話。</p></blockquote>
<p><strong>現役稼働中</strong>の<strong>Shift_JISで書かれている</strong>コードでコレに出会ってしまったら・・・。<br/>それが他の部分の改修のためにさわったコードだったりして・・・以下略。</p>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2006/02/13/125523.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP ポケットリファレンスが改訂</title>
		<link>http://saikyoline.jp/weblog/2005/09/14/094317.html</link>
		<comments>http://saikyoline.jp/weblog/2005/09/14/094317.html#comments</comments>
		<pubDate>Wed, 14 Sep 2005 00:43:17 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=107</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a title="yohgaki's blog - 改訂版PHPポケットリファレンス" href="http://blog.ohgaki.net/index.php/yohgaki/2005/09/14/phpa_a_pa_a_a_oa_a_ia_na_sa_sa_ra_seu_c_1">yohgaki&#8217;s blog &#8211; 改訂版PHPポケットリファレンス</a></p>
<blockquote><p>最新版PHPバージョンのPHP4.4, PHP5.1にもadhoc対応しています。<br />
賛否両論のサンプルスクリプトは健在ですが、ページ数の関係で言語仕様の概要を削除する事になりました。機能が増えたので言語仕様の解説を削除してもページ数は約100ページ増えています。紙の厚さが薄くなったのでページ数が増えても厚さは増していません。</p></blockquote>
<p>いつもデスクに置いてるPHPポケットリファレンスが改訂されました。<br/><br />
「～したい」な逆引きメインなので、これってPHPでどうやるんだ的なシチュエーションに遭遇したときにけっこう助けてもらってます。とりあえず・・・。</p>
<pre class="code"><code>$wants[] = "PHPポケリ";</code></pre>
<table style="border: 1px dotted #999999; font-size: 13px; text-align: left;">
<tr>
<td><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4774125024/saikyoline-22/ref=nosim/"><img src="http://images.amazon.com/images/P/4774125024.09._SCMZZZZZZZ_.jpg" width="109" height="160" alt="[改訂版] PHP ポケットリファレンス" title="[改訂版] PHP ポケットリファレンス" style="border: 0px; margin: 5px 10px 5px 5px;"/></a></td>
<td><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4774125024/saikyoline-22/ref=nosim/" style="text-decoration: none;"><span style="font-weight: bold;">[改訂版] PHP ポケットリファレンス</span><br/><span>技術評論社(2005-09-17)</span><br/>
<ul style="margin-top: 3px; margin-bottom: 3px;">
<li style="list-style: none inside;">(著)大垣 靖男</li>
</ul>
<p><span>新品価格：￥ 2,499</span><br/><span>ASIN：4774125024</span></a></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2005/09/14/094317.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mojavi Japanオープン</title>
		<link>http://saikyoline.jp/weblog/2005/06/20/234421.html</link>
		<comments>http://saikyoline.jp/weblog/2005/06/20/234421.html#comments</comments>
		<pubDate>Mon, 20 Jun 2005 14:44:21 +0000</pubDate>
		<dc:creator>yoshuki</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://saikyoline.jp/weblog/?p=67</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a title="p0t: Mojavi Japanオープン" href="http://p0t.jp/mt/archives/2005/06/mojavi_japan.html#comments">p0t: Mojavi Japanオープン</a></p>
<blockquote><p>Mojavi Japanオープンしました！</p></blockquote>
<p>PHPのフレームワークならとりあえずコレでしょ的な<strong>Mojavi</strong>ですが、<a href="http://p0t.jp/">p0t</a>のkomagataさんによって日本語のまとめページ的なものがオープンされたので早速ユーザ登録しました。<br />
お世話になるマス。</p>
]]></content:encoded>
			<wfw:commentRss>http://saikyoline.jp/weblog/2005/06/20/234421.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

