<?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>web tips around me&#187; php</title>
	<atom:link href="http://yamazon.org/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://yamazon.org</link>
	<description>ホームページ制作,SEO,CMS ...</description>
	<lastBuildDate>Sat, 04 Sep 2010 10:01:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP 現在表示中のドメイン名、ファイル名取得</title>
		<link>http://yamazon.org/other/464</link>
		<comments>http://yamazon.org/other/464#comments</comments>
		<pubDate>Thu, 15 Jul 2010 13:37:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[ドメイン名]]></category>
		<category><![CDATA[ファイル名]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=464</guid>
		<description><![CDATA[//絶対パス
echo __FILE__ . &#8216;&#8216;;
//ディレクトリパス
echo dirname(__FILE__) . &#8216;&#8216;;
//スクリプト名
echo basen [...]]]></description>
			<content:encoded><![CDATA[<p>//絶対パス<br />
echo __FILE__ . &#8216;<br />&#8216;;</p>
<p>//ディレクトリパス<br />
echo dirname(__FILE__) . &#8216;<br />&#8216;;</p>
<p>//スクリプト名<br />
echo basename(__FILE__) . &#8216;<br />&#8216;;</p>
<p>echo $_SERVER["SERVER_NAME"];<br />
echo $_SERVER["SCRIPT_NAME"];<br />
echo &#8216;?&#8217;;<br />
echo $_SERVER["QUERY_STRING"];</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/464/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;URL file- access is disabled in the server configuration&#8221;というメッセージが表示された場合の対処法</title>
		<link>http://yamazon.org/other/458</link>
		<comments>http://yamazon.org/other/458#comments</comments>
		<pubDate>Wed, 07 Jul 2010 10:40:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=458</guid>
		<description><![CDATA[■php.iniの設定が変更可能な場合
PHP コード スニペットを使用していて、ウェブページに &#8220;URL file-access is disabled in the server configuratio [...]]]></description>
			<content:encoded><![CDATA[<p>■php.iniの設定が変更可能な場合</p>
<p>PHP コード スニペットを使用していて、ウェブページに &#8220;URL file-access is disabled in the server configuration&#8221; (URL ファイル アクセスはサーバーの設定で無効になっています) エラー メッセージが表示される場合は、ウェブマスターまたはホスティング プロバイダに連絡して、PHP サーバーの設定内の allow_url_fopen と allow_url_include を有効にしてください。</p>
<p>参考サイト：https://www.google.com/adsense/support/bin/answer.py?hl=jp&#038;answer=70494</p>
<p>■phpファイル内で解決する場合</p>
<p>&lt;? php</p>
<p>function get_content($url)<br />
{<br />
    $ch = curl_init();</p>
<p>    curl_setopt ($ch, CURLOPT_URL, $url);<br />
    curl_setopt ($ch, CURLOPT_HEADER, 0);</p>
<p>    ob_start();</p>
<p>    curl_exec ($ch);<br />
    curl_close ($ch);<br />
    $string = ob_get_contents();</p>
<p>    ob_end_clean();</p>
<p>    return $string;<br />
}</p>
<p>#usage:<br />
$content = get_content (&#8221;http://www.php.net&#8221;);<br />
var_dump ($content);<br />
?></p>
<p>参考サイト：http://jp.php.net/manual/ja/function.fopen.php</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/458/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP&amp;Javascript フォームのチェックボックスを全選択させる（配列）</title>
		<link>http://yamazon.org/other/383</link>
		<comments>http://yamazon.org/other/383#comments</comments>
		<pubDate>Fri, 11 Jun 2010 05:21:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[チェックボックス]]></category>
		<category><![CDATA[フォーム]]></category>
		<category><![CDATA[全選択]]></category>
		<category><![CDATA[配列]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=383</guid>
		<description><![CDATA[フォームのチェックボックスをjavascriptを使って全選択し、チェックボックスの値を配列として受け取る。
&#60;SCRIPT TYPE=&#8221;text/javascript&#8221;>
&#60;!&#8 [...]]]></description>
			<content:encoded><![CDATA[<p>フォームのチェックボックスをjavascriptを使って全選択し、チェックボックスの値を配列として受け取る。</p>
<p>&lt;SCRIPT TYPE=&#8221;text/javascript&#8221;><br />
&lt;!&#8211;<br />
function allcheck(targetForm,flag){<br />
　for(n=0;n<=targetForm.length-1;n++){<br />
　　if(targetForm.elements[n].type == "checkbox"){<br />
　　　targetForm.elements[n].checked = flag;<br />
　　}<br />
　}<br />
}<br />
--><br />
&lt;/SCRIPT></p>
<p>&lt;input type=&#8221;button&#8221; value=&#8221;全選択&#8221; onClick=&#8221;allcheck(this.form,true)&#8221;/><br />
&lt;input type=&#8221;button&#8221; value=&#8221;全解除&#8221; onClick=&#8221;allcheck(this.form,false)&#8221;/></p>
<p>&lt;label>&lt;input name=&#8221;reg_check[]&#8221; type=&#8221;checkbox&#8221; value=&#8221;1&#8243; /> 相互リンクを申請する</label><br />
&lt;label>&lt;input name=&#8221;reg_check[]&#8221; type=&#8221;checkbox&#8221; value=&#8221;2&#8243; /> 相互リンクを申請する</label><br />
&lt;label>&lt;input name=&#8221;reg_check[]&#8221; type=&#8221;checkbox&#8221; value=&#8221;3&#8243; /> 相互リンクを申請する</label><br />
&lt;label>&lt;input name=&#8221;reg_check[]&#8221; type=&#8221;checkbox&#8221; value=&#8221;4&#8243; /> 相互リンクを申請する</label></p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/383/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP session 破棄</title>
		<link>http://yamazon.org/other/381</link>
		<comments>http://yamazon.org/other/381#comments</comments>
		<pubDate>Fri, 11 Jun 2010 03:53:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[セッション]]></category>
		<category><![CDATA[破棄]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=381</guid>
		<description><![CDATA[PHPでセッションを完全に破棄する
&#60;?php
// セッション変数を全て解除する
$_SESSION = array();
// セッションを切断するにはセッションクッキーも削除する。
// Note: セッショ [...]]]></description>
			<content:encoded><![CDATA[<p>PHPでセッションを完全に破棄する</p>
<p>&lt;?php<br />
// セッション変数を全て解除する<br />
$_SESSION = array();</p>
<p>// セッションを切断するにはセッションクッキーも削除する。<br />
// Note: セッション情報だけでなくセッションを破壊する。<br />
if (isset($_COOKIE[session_name()])) {<br />
    setcookie(session_name(), &#8221;, time()-42000, &#8216;/&#8217;);<br />
}</p>
<p>// 最終的に、セッションを破壊する<br />
session_destroy();<br />
?></p>
<p>参考サイト：http://d.hatena.ne.jp/Kappuccino/20080726/1217049706</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/381/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 配列を展開する　foreach</title>
		<link>http://yamazon.org/other/377</link>
		<comments>http://yamazon.org/other/377#comments</comments>
		<pubDate>Tue, 08 Jun 2010 10:26:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=377</guid>
		<description><![CDATA[foreachで、配列を展開する
foreach ($array as $key => $val) {
	echo $key ;
	echo $val;
}
]]></description>
			<content:encoded><![CDATA[<p>foreachで、配列を展開する</p>
<p>foreach ($array as $key => $val) {<br />
	echo $key ;<br />
	echo $val;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/377/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 配列から空要素を削除する</title>
		<link>http://yamazon.org/other/375</link>
		<comments>http://yamazon.org/other/375#comments</comments>
		<pubDate>Tue, 08 Jun 2010 10:18:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[削除]]></category>
		<category><![CDATA[空]]></category>
		<category><![CDATA[要素]]></category>
		<category><![CDATA[配列]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=375</guid>
		<description><![CDATA[以下のように実行することで、配列内から空要素を削除することが出来ます。
		//空要素を削除
		$link_accept_list = array_merge(array_diff($link_accept_list, [...]]]></description>
			<content:encoded><![CDATA[<p>以下のように実行することで、配列内から空要素を削除することが出来ます。</p>
<p>		//空要素を削除<br />
		$link_accept_list = array_merge(array_diff($link_accept_list, array(&#8221;")));</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/375/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 日付の減算・差分を求める</title>
		<link>http://yamazon.org/other/368</link>
		<comments>http://yamazon.org/other/368#comments</comments>
		<pubDate>Tue, 01 Jun 2010 10:09:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[差分]]></category>
		<category><![CDATA[日付]]></category>
		<category><![CDATA[減算]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=368</guid>
		<description><![CDATA[define( &#8220;ONE_DAY_SEC&#8221;, 24 * 3600 );
// 日付けの差分をとる関数
function dateDiff( $date1, $date2 ) {
    retur [...]]]></description>
			<content:encoded><![CDATA[<p>define( &#8220;ONE_DAY_SEC&#8221;, 24 * 3600 );</p>
<p>// 日付けの差分をとる関数<br />
function dateDiff( $date1, $date2 ) {<br />
    return ( strtotime( $date1 ) &#8211; strtotime( $date2 ) ) / ONE_DAY_SEC;<br />
}</p>
<p>// 実行サンプル<br />
    $date1 = date(&#8217;Y/m/d&#8217;);<br />
    $date2 = &#8220;2010/06/01&#8243;;</p>
<p>    $result = (dateDiff( $date1, $date2 )+1);</p>
<p>これで$resultには、2010/06/01　から　現在の日付までの経過日数を求めることが出来る。</p>
<p>参考サイト：http://q.hatena.ne.jp/1169605670</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/368/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP　配列の並び替え</title>
		<link>http://yamazon.org/other/366</link>
		<comments>http://yamazon.org/other/366#comments</comments>
		<pubDate>Fri, 21 May 2010 00:29:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[並び替え]]></category>
		<category><![CDATA[配列]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=366</guid>
		<description><![CDATA[			asort ($res_get_email,SORT_STRING); 
sort (配列,パラメータ);
このパラメータを次の３つから選択することで並べ方をコントロールすることができます。
SORT_REGULA [...]]]></description>
			<content:encoded><![CDATA[<p>			asort ($res_get_email,SORT_STRING); </p>
<p>sort (配列,パラメータ);<br />
このパラメータを次の３つから選択することで並べ方をコントロールすることができます。<br />
SORT_REGULAR &#8211; 通常通りに項目を比較<br />
SORT_NUMERIC &#8211; 数値的に項目を比較<br />
SORT_STRING &#8211; 文字列として項目を比較</p>
<p>参考URL：http://w1.nirai.ne.jp/freeze/main/file12.html</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/366/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP フォームの処理</title>
		<link>http://yamazon.org/other/351</link>
		<comments>http://yamazon.org/other/351#comments</comments>
		<pubDate>Sat, 17 Apr 2010 11:32:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[htmlspecialchars]]></category>
		<category><![CDATA[nl2br]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[stripslashes]]></category>
		<category><![CDATA[フォーム]]></category>
		<category><![CDATA[改行]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=351</guid>
		<description><![CDATA[# stripcslashes() &#8212;- C言語と同様にバックスラッシュでクォートされた文字列を元に戻す
# htmlentities() &#8212;- 適用可能な文字を全てHTML エンティティに変換す [...]]]></description>
			<content:encoded><![CDATA[<p># stripcslashes() &#8212;- C言語と同様にバックスラッシュでクォートされた文字列を元に戻す</p>
<p># htmlentities() &#8212;- 適用可能な文字を全てHTML エンティティに変換する</p>
<p># nl2br()  &#8212;- 改行文字の前にHTMLの改行タグを挿入する</p>
<p># strip_tags() &#8212;- 文字列からHTMLタグ、および PHPタグを取り除く</p>
<p><span id="more-351"></span><br />
$text はフォームから受け取る文字列。</p>
<p>// HTML文字のエスケープ<br />
$text = htmlspecialchars( $_POST["messege"] );</p>
<p>// magic_quotes_gpcの値がONなら\削除<br />
if ( get_magic_quotes_gpc() ) {<br />
  $text = stripslashes( $text );<br />
}</p>
<p>// 改行処理<br />
$text = nl2br($text);</p>
<p>print_r($text);</p>
<p>これでフォームから送信された文章内の改行をそのまま表示させることが出来る。</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/351/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php　フォームのPOST送信で配列を扱う場合</title>
		<link>http://yamazon.org/other/340</link>
		<comments>http://yamazon.org/other/340#comments</comments>
		<pubDate>Thu, 15 Apr 2010 12:05:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[POST送信]]></category>
		<category><![CDATA[配列]]></category>

		<guid isPermaLink="false">http://yamazon.org/?p=340</guid>
		<description><![CDATA[htmlのフォーム内のcheckboxなどで、配列を扱いたい場合は、以下のように name 属性に []　をつけます。これで配列として扱えます。
&#60;input type=&#8221;checkbox&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>htmlのフォーム内のcheckboxなどで、配列を扱いたい場合は、以下のように name 属性に []　をつけます。これで配列として扱えます。<br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;item[]&#8221; value=&#8221;"><br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;item[]&#8221; value=&#8221;"><br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;item[]&#8221; value=&#8221;"><br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;item[]&#8221; value=&#8221;"></p>
<p>その後、受け取った　$_post['item']　を　foreach　などで回せば、自由に配列を扱うことが出来ます。</p>
]]></content:encoded>
			<wfw:commentRss>http://yamazon.org/other/340/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
