<?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>配列 | ウダ2Blog</title>
	<atom:link href="https://uda2.com/blog/tag/%e9%85%8d%e5%88%97/feed/" rel="self" type="application/rss+xml" />
	<link>https://uda2.com/blog</link>
	<description>大阪でフリーランスとしてWEB制作している管理人が気になった技術をメモったり、作ったツールの紹介などを綴っているブログです。</description>
	<lastBuildDate>Mon, 09 Jul 2007 12:26:47 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>とびとびの配列</title>
		<link>https://uda2.com/blog/post_7/</link>
					<comments>https://uda2.com/blog/post_7/#respond</comments>
		
		<dc:creator><![CDATA[uda2]]></dc:creator>
		<pubDate>Mon, 09 Jul 2007 12:26:47 +0000</pubDate>
				<category><![CDATA[制作日記]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[配列]]></category>
		<guid isPermaLink="false">http://uda2.com/wordpress/2007/07/post_7.html</guid>

					<description><![CDATA[<p>配列を結合させ文字列を返すimplodeって関数が変な動きをしたので調べてみると $a = array(&#8220;A&#8221;,&#8221;B&#8221;,&#8221;C&#8221;); $a[4] =</p>
The post <a href="https://uda2.com/blog/post_7/">とびとびの配列</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>配列を結合させ文字列を返すimplodeって関数が変な動きをしたので調べてみると<br />
$a = array(&#8220;A&#8221;,&#8221;B&#8221;,&#8221;C&#8221;);<br />
$a[4] = &#8220;E&#8221;;<br />
print implode(&#8220;/&#8221;,$a);<br />
ってやると<br />
A/B/C//E<br />
となると思ってたら<br />
A/B/C/E<br />
とかなる。</p>
<p><span id="more-555"></span><br />
そこで指定していない配列にはnilになってるのかと思うと<br />
if ($a[3] == nil) print&#8221;nil&#8221;;<br />
では何も返ってこなくて<br />
if ($a[3] == &#8220;&#8221;) print&#8221;kara&#8221;;<br />
だと返ってくる。<br />
$a = array(&#8220;A&#8221;,&#8221;B&#8221;,&#8221;C&#8221;);<br />
if ($a[3] == &#8220;&#8221;) $a[3] = &#8220;&#8221;;<br />
$a[4] = &#8220;E&#8221;;<br />
print implode(&#8220;/&#8221;,$a);<br />
とあまり意味の無さそうな事をすると<br />
A/B/C//E<br />
と当初意図していた通りの答えが返ってくる。<br />
無いは無いで明示しないとダメってことか？</p>The post <a href="https://uda2.com/blog/post_7/">とびとびの配列</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://uda2.com/blog/post_7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP：配列の検索</title>
		<link>https://uda2.com/blog/php_2/</link>
					<comments>https://uda2.com/blog/php_2/#respond</comments>
		
		<dc:creator><![CDATA[uda2]]></dc:creator>
		<pubDate>Sun, 01 Jul 2007 12:14:12 +0000</pubDate>
				<category><![CDATA[制作日記]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[検索]]></category>
		<category><![CDATA[配列]]></category>
		<guid isPermaLink="false">http://uda2.com/wordpress/2007/07/php_2.html</guid>

					<description><![CDATA[<p>配列の中を検索する際の関数としてarray-search を使っていたら、テスト環境（PHPのバージョンが違う）で返す値が違うことが発覚。 いちいちテスト時とアップ時を変えるのが面倒だなと思ってたら in-arrayを使</p>
The post <a href="https://uda2.com/blog/php_2/">PHP：配列の検索</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>配列の中を検索する際の関数として<a href="http://manual.xwd.jp/function.array-search.html">array-search</a><br />
を使っていたら、テスト環境（PHPのバージョンが違う）で返す値が違うことが発覚。<br />
いちいちテスト時とアップ時を変えるのが面倒だなと思ってたら<br />
<a href="http://manual.xwd.jp/function.in-array.html">in-array</a>を使ったら解決した。<br />
<a href="http://manual.xwd.jp/function.in-array.html">in-array</a>もPHPのバージョンにより微妙な違いがあるらしいけど今のところ無問題。</p>The post <a href="https://uda2.com/blog/php_2/">PHP：配列の検索</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://uda2.com/blog/php_2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
