<?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>references</title>
	<atom:link href="http://www.gainet.biz/references/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gainet.biz/references</link>
	<description>サイト ホームページ制作・WEBコンサルティング～GAINET（ガイネット）～北海道旭川 site</description>
	<lastBuildDate>Fri, 03 Feb 2012 09:59:53 +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>WorsPressのネタ～抜粋表示に「続きを読む」のリンクを付ける</title>
		<link>http://www.gainet.biz/references/article/worspress_new_excerpt_more_1.php</link>
		<comments>http://www.gainet.biz/references/article/worspress_new_excerpt_more_1.php#comments</comments>
		<pubDate>Wed, 18 Jan 2012 07:08:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPressのネタ]]></category>

		<guid isPermaLink="false">http://www.gainet.biz/references/?p=60</guid>
		<description><![CDATA[抜粋表示の[...]の表示を変えたり、「続きを読む」のリンクを付ける]]></description>
			<content:encoded><![CDATA[抜粋表示の[...]の表示を変えたり、「続きを読む」のリンクを付ける

<span id="more-60"></span>

<pre class="brush: php; title: ; notranslate">
function new_excerpt_more($post) {
	return '&lt;a href=&quot;'. get_permalink($post-&gt;ID) . '&quot;&gt;' . '続きを読む' . '&lt;/a&gt;';
}
add_filter('excerpt_more', 'new_excerpt_more');
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/worspress_new_excerpt_more_1.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WorsPressのネタ～抜粋表示（日本語、マルチバイト）</title>
		<link>http://www.gainet.biz/references/article/wp_new_excerpt_mblength_1.php</link>
		<comments>http://www.gainet.biz/references/article/wp_new_excerpt_mblength_1.php#comments</comments>
		<pubDate>Wed, 18 Jan 2012 06:41:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPressのネタ]]></category>

		<guid isPermaLink="false">http://www.gainet.biz/references/?p=55</guid>
		<description><![CDATA[抜粋文字表示数の設定 マルチバイトの場合の設定 function.phpに挿入]]></description>
			<content:encoded><![CDATA[抜粋文字表示数の設定
<span id="more-55"></span>

マルチバイトの場合の設定

function.phpに挿入

<pre class="brush: php; title: ; notranslate">
function new_excerpt_mblength($length) {
     return 100;
}
add_filter('excerpt_mblength', 'new_excerpt_mblength');
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/wp_new_excerpt_mblength_1.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPのネタ～ページのエラー</title>
		<link>http://www.gainet.biz/references/article/ref_php_06.php</link>
		<comments>http://www.gainet.biz/references/article/ref_php_06.php#comments</comments>
		<pubDate>Sat, 27 Aug 2011 09:47:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHPのネタ]]></category>

		<guid isPermaLink="false">http://asahikawa.org/references/?p=36</guid>
		<description><![CDATA[PHPを利用しているとサーバーの仕様、PHPやデータベースのバージョンなどによって、PHPのエラーが出たり出なかったりなんていう症状に出くわす事がある。 プログラムソースに間違いは無いはずなのになんていう場合は装である可 [...]]]></description>
			<content:encoded><![CDATA[PHPを利用しているとサーバーの仕様、PHPやデータベースのバージョンなどによって、PHPのエラーが出たり出なかったりなんていう症状に出くわす事がある。<span id="more-36"></span>

プログラムソースに間違いは無いはずなのになんていう場合は装である可能性を疑ってみましょう。

エラーが出るんだけど、何回か更新を押すと正常に作動するなんて時がそうです。

更に、表示はされるけど一部特定の文字化けが治らないとか。

PHPの4.3.11以上でSQLでユニコードやEUC-JPが入り乱れたりすると、いくらコード宣言をしても無駄だったりします。

そんな時は、.htaccessで言語と文字コードを固定してやります。

利用は自己責任で。

（例）EUC-JPで日本語の場合
php_value mbstring.language Japanese
php_flag mbstring.encoding_translation On
php_value mbstring.script_encoding EUC-JP
php_value mbstring.internal_encoding EUC-JP
php_value default_charset EUC-JP
php_value mbstring.http_output pass
php_value mbstring.http_input EUC-JP]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/ref_php_06.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPのネタ～3桁カンマ区切りと小数点以下揃え</title>
		<link>http://www.gainet.biz/references/article/ref_php_05.php</link>
		<comments>http://www.gainet.biz/references/article/ref_php_05.php#comments</comments>
		<pubDate>Sat, 27 Aug 2011 09:43:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHPのネタ]]></category>

		<guid isPermaLink="false">http://asahikawa.org/references/?p=33</guid>
		<description><![CDATA[商品の価格を表示する際に、日本円だと３桁のカンマ区切り表示したい場合があります。また、小数点以下の文字数をそろえたい時にはPHPでは、number_format()関数の仕様が有効です。 小数点以下の桁揃えはドル表示やユ [...]]]></description>
			<content:encoded><![CDATA[
<p>商品の価格を表示する際に、日本円だと３桁のカンマ区切り表示したい場合があります。<span id="more-33"></span>また、小数点以下の文字数をそろえたい時にはPHPでは、number_format()関数の仕様が有効です。</p>
<p>小数点以下の桁揃えはドル表示やユーロ表示などの時に有効ですね。</p>
<p>&nbsp;</p>
<h3>３桁をカンマで区切る場合</h3>
<p>number_format(変数) とこれだけ。</p>
<p>&nbsp;</p>
<h3>小数点以下の桁をそろえる場合</h3>
<p>number_format(変数 , 桁数) と桁数を指定する。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/ref_php_05.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPのネタ～テキストの定規表現などの判定</title>
		<link>http://www.gainet.biz/references/article/ref_php_04.php</link>
		<comments>http://www.gainet.biz/references/article/ref_php_04.php#comments</comments>
		<pubDate>Sat, 27 Aug 2011 09:42:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHPのネタ]]></category>

		<guid isPermaLink="false">http://asahikawa.org/references/?p=31</guid>
		<description><![CDATA[時々、使う必要のあるテキストの定規表現などの判定です。 入力された名前を全角かどうかや、ひらがなかどうかなど、又は半角えいすうじかどうかなど。。。 文字コードはEUC-JPです。 完全かどうかは正直自信無し・・・（＾＾； [...]]]></description>
			<content:encoded><![CDATA[時々、使う必要のあるテキストの定規表現などの判定です。<span id="more-31"></span>

入力された名前を全角かどうかや、ひらがなかどうかなど、又は半角えいすうじかどうかなど。。。

文字コードはEUC-JPです。

完全かどうかは正直自信無し・・・（＾＾；

よって、利用は自己責任で。
<h3>全角で日本語なら</h3>
mb_ereg(&#8220;^[ぁ-熙　ー－\x20]+$&#8221;, 変数)
<h3>ひらがなかどうか</h3>
mb_ereg(&#8220;^[ぁ-ん　ー－\x20]+$&#8221;, 変数)
<h3>半角英数字か</h3>
ereg(&#8220;^[\x21-\x7e]+$&#8221;, 変数)
<h3>半角数字か</h3>
is_numeric(変数)]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/ref_php_04.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPのネタ～スーパーグローバル変数</title>
		<link>http://www.gainet.biz/references/article/ref_php_03.php</link>
		<comments>http://www.gainet.biz/references/article/ref_php_03.php#comments</comments>
		<pubDate>Sat, 27 Aug 2011 09:40:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHPのネタ]]></category>

		<guid isPermaLink="false">http://asahikawa.org/references/?p=29</guid>
		<description><![CDATA[※全てのスーパーグローバル変数を網羅しているわけではありません。時々使う物で忘れやすい物だけです。 （$PHP_SELF）現在実行中のファイル URLの？以降の文字列 同じパラメータを渡すときに便利 閲覧者が前に見ていた [...]]]></description>
			<content:encoded><![CDATA[
<p>※全てのスーパーグローバル変数を網羅しているわけではありません。時々使う物で忘れやすい物だけです。<span id="more-29"></span></p>
<p>（$PHP_SELF）現在実行中のファイル</p>
<pre class="brush: php; title: ; notranslate">$_SERVER['PHP_SELF'];</pre><br /><br />
<p>URLの？以降の文字列</p>
<pre class="brush: php; title: ; notranslate">$_SERVER['QUERY_STRING'];</pre><br /><br />
<p>同じパラメータを渡すときに便利</p>
<p>閲覧者が前に見ていたページ</p>
<pre class="brush: php; title: ; notranslate">$_SERVER['HTTP_REFERER''];</pre><br /><br />
<p>User-Agent:ヘッダ</p>
<pre class="brush: php; title: ; notranslate">$_SERVER['HTTP_USER_AGENT'];</pre><br /><br />
<p>閲覧者のIPアドレス</p>
<pre class="brush: php; title: ; notranslate">$_SERVER['REMOTE_ADDR'];</pre><br /><br />
<p>リモートホスト</p>
<pre class="brush: php; title: ; notranslate">$_SERVER['REMOTE_HOST'];</pre><br /><br />
<p>Host:ヘッダ、大抵ドメイン名</p>
<pre class="brush: php; title: ; notranslate">$_SERVER['HTTP_HOST'];</pre><br /><br />
<p>URI</p>
<pre class="brush: php; title: ; notranslate">$_SERVER['REQUEST_URI'];</pre><br /><br />
<p>元のファイル名</p>
<pre class="brush: php; title: ; notranslate">$_FILES['アップロードファイルのフォームネーム']['name'];</pre><br /><br />
<p>MIMEタイプ</p>
<pre class="brush: php; title: ; notranslate">$_FILES['アップロードファイルのフォームネーム']['type'];</pre><br /><br />
<p>サーバー上のテンプファイル名</p>
<pre class="brush: php; title: ; notranslate">$_FILES['アップロードファイルのフォームネーム']['tmp_name'];</pre><br /><br />
<p>アップロードファイルのバイト数</p>
<pre class="brush: php; title: ; notranslate">$_FILES['アップロードファイルのフォームネーム']['size'];</pre><br /><br />
<p>エラーコード</p>
<pre class="brush: php; title: ; notranslate">$_FILES['アップロードファイルのフォームネーム']['error'];</pre><br /><br />]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/ref_php_03.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPのネタ～．ｈｔｍｌでもＰＨＰが使えるようにする</title>
		<link>http://www.gainet.biz/references/article/ref_php_02.php</link>
		<comments>http://www.gainet.biz/references/article/ref_php_02.php#comments</comments>
		<pubDate>Sat, 27 Aug 2011 09:39:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHPのネタ]]></category>

		<guid isPermaLink="false">http://asahikawa.org/references/?p=27</guid>
		<description><![CDATA[通常の状態では、.phpの拡張子のファイルでしか、ＰＨＰスクリプトは実行できませんが.htaccessによる設定でそれ以外の拡張子ファイルでもＰＨＰを動かす事が可能になります。 既存のホームページアドレスでＰＨＰ化したい [...]]]></description>
			<content:encoded><![CDATA[
<p>通常の状態では、.phpの拡張子のファイルでしか、ＰＨＰスクリプトは実行できませんが.htaccessによる設定でそれ以外の拡張子ファイルでもＰＨＰを動かす事が可能になります。<span id="more-27"></span> 既存のホームページアドレスでＰＨＰ化したいときに便利。</p>
<p>全く存在しない拡張子で設定も可能です。</p>
<p>※.htaccessの利用できるサーバーが条件です。</p>
<p>※.htmlを設定した場合、パフォーマンスの問題が言われる事がありますが、私の経験では気にするほどのパフォーマンスの低下を感じた事はありません。が、利用は自己責任で。。。（表示のパフォーマンスについては画像の調整やソースの見直しの方が効果的です。）</p>
<p>例にあるテキストを.htaccessで保存して利用したいディレクトリにアップロードしてください。</p>
<p>念のためインデックスの宣言もしています。</p>
<p>他の宣言をかさねる事も可能です。</p>
<p>&nbsp;</p>
<p>（例）</p>
<p>Addtype application/x-httpd-php .html .htm .shtml .php</p>
<p>DirectoryIndex index.htm index.html index.cgi index.php index.shtml</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/ref_php_02.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPのネタ～Date関数のフォーマット</title>
		<link>http://www.gainet.biz/references/article/ref_php_01.php</link>
		<comments>http://www.gainet.biz/references/article/ref_php_01.php#comments</comments>
		<pubDate>Sat, 27 Aug 2011 09:38:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHPのネタ]]></category>

		<guid isPermaLink="false">http://asahikawa.org/references/?p=25</guid>
		<description><![CDATA[Date(&#8220;Y年n月j日&#8221;); 日時を指定された書式で返す。その関数で使う指定書式一覧。 &#160; 文字 機能 a ａｍかｐｍ A ＡＭかＰＭ d 日を常に2桁で返す j 日付の前に０をつけな [...]]]></description>
			<content:encoded><![CDATA[Date(&#8220;Y年n月j日&#8221;);<span id="more-25"></span>

日時を指定された書式で返す。その関数で使う指定書式一覧。

&nbsp;
<table border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr style="color: #ffffff;" bgcolor="#666666">
<td>文字</td>
<td>機能</td>
</tr>
<tr>
<td>a</td>
<td>ａｍかｐｍ</td>
</tr>
<tr>
<td>A</td>
<td>ＡＭかＰＭ</td>
</tr>
<tr>
<td>d</td>
<td>日を常に2桁で返す</td>
</tr>
<tr>
<td>j</td>
<td>日付の前に０をつけない</td>
</tr>
<tr>
<td>m</td>
<td>月を常に2桁で返す</td>
</tr>
<tr>
<td>n</td>
<td>月の前に０をつけない</td>
</tr>
<tr>
<td>M</td>
<td>月を英語の３文字で表現する</td>
</tr>
<tr>
<td>F</td>
<td>月を英語のフルスペルで表現する</td>
</tr>
<tr>
<td>y</td>
<td>西暦年を下２桁で返す</td>
</tr>
<tr>
<td>Y</td>
<td>西暦年を４桁で返す</td>
</tr>
<tr>
<td>D</td>
<td>曜日を英語の３文字で表現する</td>
</tr>
<tr>
<td>l</td>
<td>曜日を英語のフルスペルで表現する</td>
</tr>
<tr>
<td>w</td>
<td>曜日を０～６までの数字で返す</td>
</tr>
<tr>
<td>r</td>
<td>ＲＦＣ８２２定義方式で出力</td>
</tr>
<tr>
<td>h</td>
<td>時を２桁の１２時間単位で</td>
</tr>
<tr>
<td>H</td>
<td>時を２桁の２４時間単位で</td>
</tr>
<tr>
<td>g</td>
<td>時を１２時間単位で前に０を付けない</td>
</tr>
<tr>
<td>G</td>
<td>時を２４時間単位で前に０を付けない</td>
</tr>
<tr>
<td>i</td>
<td>分を２桁で返す</td>
</tr>
<tr>
<td>s</td>
<td>秒を２桁で返す</td>
</tr>
<tr>
<td>U</td>
<td>Ｕｎｉｘタイムスタンプ</td>
</tr>
<tr>
<td>t</td>
<td>指定した月の日数を返す</td>
</tr>
<tr>
<td>z</td>
<td>年間の通算日数</td>
</tr>
<tr>
<td>L</td>
<td>うるう年の論理値</td>
</tr>
<tr>
<td>S</td>
<td>英語形式の序数を表すサフィックスを２文字で</td>
</tr>
<tr>
<td>Z</td>
<td>タイムゾーンのオフセット秒数</td>
</tr>
<tr>
<td>T</td>
<td>タイムゾーンの設定</td>
</tr>
</tbody>
</table>
&nbsp;]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/ref_php_01.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSSのネタ～backgroundが表示されない。Clearfix part２</title>
		<link>http://www.gainet.biz/references/article/ref_css_07-php.php</link>
		<comments>http://www.gainet.biz/references/article/ref_css_07-php.php#comments</comments>
		<pubDate>Sat, 27 Aug 2011 09:36:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSSのネタ]]></category>

		<guid isPermaLink="false">http://asahikawa.org/references/?p=23</guid>
		<description><![CDATA[floatしたDIV要素や画像などが枠からはみ出てしまう時に有効なClearfixですが、同じ理由から陥りやすい事があります。 親要素にbackgroundで背景に画像を配置したのに画像が表示されない。 なんてことになっ [...]]]></description>
			<content:encoded><![CDATA[
<p>floatしたDIV要素や画像などが枠からはみ出てしまう時に有効なClearfixですが、同じ理由から陥りやすい事があります。<span id="more-23"></span></p>
<p>親要素にbackgroundで背景に画像を配置したのに画像が表示されない。</p>
<p>なんてことになった事はありませんか。</p>
<p>ひょっとしたら、背景画像を指定している要素にClearfixを指定すれば背景が表示されるようになるかもしれません。</p>
<p>（他の原因かもしれませんが。）</p>
<p>要するに、子要素がfloatされているために、背景に指定した要素が表示されていないわけです。</p>
<p>モダンブラウザで背景画像が表示されない、または、子要素の上で切れてしまっている、などの現象ではまってしまった時は、疑ってみて下さい。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/ref_css_07-php.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSSのネタ～CSSでインラインフレーム風に</title>
		<link>http://www.gainet.biz/references/article/ref_css_06.php</link>
		<comments>http://www.gainet.biz/references/article/ref_css_06.php#comments</comments>
		<pubDate>Sat, 27 Aug 2011 09:33:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSSのネタ]]></category>

		<guid isPermaLink="false">http://asahikawa.org/references/?p=18</guid>
		<description><![CDATA[インラインフレーム風にしたい時でも、いまさらインラインフレームなんて使いたくないのが心情です。 そんな時はCSSを使ってもインラインフレーム風に表示できます。 CSSが対応しなくても表示されるので便利。 《見本テキスト》 [...]]]></description>
			<content:encoded><![CDATA[<p>インラインフレーム風にしたい時でも、いまさらインラインフレームなんて使いたくないのが心情です。<span id="more-18"></span></p>
<p>そんな時はCSSを使ってもインラインフレーム風に表示できます。</p>
<p>CSSが対応しなくても表示されるので便利。</p>
<p>
<pre class="brush: css; title: ; notranslate">
{
padding:10px;
width:300px;
height:200px;
border:solid 1px #666666;
overflow:scroll;
}
</pre>
<br /><br /></p>
<div style="font-size: 12px; width: 350px; height: 200px; border: solid 1px #666; overflow: scroll; padding: 10px;">《見本テキスト》<strong>北海道でホームページ作成ならガイネットへ</strong> ガイネットは北海道旭川市にてホームページ制作とＩＴコンサルティングを業務内容としています。 いくらカッコイイホームページを作っただけでは、ホームページから売り上げを上げることは難しいのです。 ホームページをどのように使うのかという企画から、もちろん体裁の整った上でユーザーの使いやすさを重視したホームページをつくり、 ホームページの運営と顧客対応までをサポートするまでのコンサルティングサービスも提供しています。 ＳＥＯ対策重視のホームページ運営では、安定した長期にわたる売り上げを作ることは難しいのです。 リピーター客を育て、口コミを作る事を重視した運営で新しい道を開く事が出来るでしょう。 《見本テキスト》 <strong>個人情報の取り扱い</strong> サイト上より入力した個人情報や、業務上収集した個人情報は、当方の業務以外で使用することはありません。 個人情報を利用者本人又は情報保有の責任者より許可を得た場合、公的機関より正式な照会があった場合、関係法令に該当する請求があった場合は情報を開示します。 利用者自ら、又は第三者がサイト上で開示した個人情報は、当方では責任を持ちませんのでご了承下さい。 当ホームページにリンクされている第三者のホームページにおけるお客様の個人情報の保護については、責任を負いません。 <strong>リンクについて</strong> 当ホームページへのリンクは、営利を目的とせず、フレームなしで行うなどの条件を満たしている限り、原則として自由ですが、犯罪行為や公共に反するサイトからのリンクはお断りさせていただきます。 相互リンクをご希望の方はご一報下さい。相互リンク先のサイトの内容により判断させていただきます。 ブログに送られたトラックバックは、当方にそぐわないと判断した場合削除させていただきます。 <strong>第三者より入力された情報の取り扱いについて</strong> 掲示板、コミュニティへの書き込みやブログのコメントへの書き込みが当方が運営するホームページにそぐわないと判断される場合削除させていただきます。 《見本テキスト》</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gainet.biz/references/article/ref_css_06.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

