<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	「PHP一个数组以标签为单位循环」的评论	</title>
	<atom:link href="https://www.mudbest.com/%E4%B8%80%E4%B8%AA%E6%95%B0%E7%BB%84%E4%BB%A5%E6%A0%87%E7%AD%BE%E4%B8%BA%E5%8D%95%E4%BD%8D%E5%BE%AA%E7%8E%AF/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mudbest.com/%e4%b8%80%e4%b8%aa%e6%95%b0%e7%bb%84%e4%bb%a5%e6%a0%87%e7%ad%be%e4%b8%ba%e5%8d%95%e4%bd%8d%e5%be%aa%e7%8e%af/</link>
	<description>行影不离,忘之却步.</description>
	<lastBuildDate>Mon, 01 Oct 2012 09:42:31 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>
		评论者：shadow		</title>
		<link>https://www.mudbest.com/%e4%b8%80%e4%b8%aa%e6%95%b0%e7%bb%84%e4%bb%a5%e6%a0%87%e7%ad%be%e4%b8%ba%e5%8d%95%e4%bd%8d%e5%be%aa%e7%8e%af/#comment-219</link>

		<dc:creator><![CDATA[shadow]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 16:59:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.mudbest.com/?p=752#comment-219</guid>

					<description><![CDATA[&lt;?php
$fruits = array(&quot;d&quot; =&gt; &quot;lemon&quot;, &quot;a&quot; =&gt; &quot;orange&quot;, &quot;b&quot; =&gt; &quot;banana&quot;, &quot;c&quot; =&gt; &quot;apple&quot;);

function test_alter(&amp;$item1, $key, $prefix)
{
    $item1 = &quot;$prefix: $item1&quot;;
}

function test_print($item2, $key)
{
    echo &quot;$key. $item2&lt;br /&gt;\n&quot;;
}

echo &quot;Before ...:\n&quot;;
array_walk($fruits, &#039;test_print&#039;);

array_walk($fruits, &#039;test_alter&#039;, &#039;fruit&#039;);
echo &quot;... and after:\n&quot;;

array_walk($fruits, &#039;test_print&#039;);
?&gt; 

才翻出array_walk

数组不全，帮你补上了，不知道对不对。

效果
Before ...:
d. lemon
a. orange
b. banana
c. apple
... and after:
d. fruit: lemon
a. fruit: orange
b. fruit: banana
c. fruit: apple
]]></description>
			<content:encoded><![CDATA[<p><?php
$fruits = array("d" => &#8220;lemon&#8221;, &#8220;a&#8221; => &#8220;orange&#8221;, &#8220;b&#8221; => &#8220;banana&#8221;, &#8220;c&#8221; => &#8220;apple&#8221;);</p>
<p>function test_alter(&#038;$item1, $key, $prefix)<br />
{<br />
    $item1 = &#8220;$prefix: $item1&#8221;;<br />
}</p>
<p>function test_print($item2, $key)<br />
{<br />
    echo &#8220;$key. $item2<br />\n&#8221;;<br />
}</p>
<p>echo &#8220;Before &#8230;:\n&#8221;;<br />
array_walk($fruits, &#8216;test_print&#8217;);</p>
<p>array_walk($fruits, &#8216;test_alter&#8217;, &#8216;fruit&#8217;);<br />
echo &#8220;&#8230; and after:\n&#8221;;</p>
<p>array_walk($fruits, &#8216;test_print&#8217;);<br />
?> </p>
<p>才翻出array_walk</p>
<p>数组不全，帮你补上了，不知道对不对。</p>
<p>效果<br />
Before &#8230;:<br />
d. lemon<br />
a. orange<br />
b. banana<br />
c. apple<br />
&#8230; and after:<br />
d. fruit: lemon<br />
a. fruit: orange<br />
b. fruit: banana<br />
c. fruit: apple</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：shadow		</title>
		<link>https://www.mudbest.com/%e4%b8%80%e4%b8%aa%e6%95%b0%e7%bb%84%e4%bb%a5%e6%a0%87%e7%ad%be%e4%b8%ba%e5%8d%95%e4%bd%8d%e5%be%aa%e7%8e%af/#comment-218</link>

		<dc:creator><![CDATA[shadow]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 16:47:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.mudbest.com/?p=752#comment-218</guid>

					<description><![CDATA[楼上的这种也不错，貌似代码没全吧？]]></description>
			<content:encoded><![CDATA[<p>楼上的这种也不错，貌似代码没全吧？</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：danielwang		</title>
		<link>https://www.mudbest.com/%e4%b8%80%e4%b8%aa%e6%95%b0%e7%bb%84%e4%bb%a5%e6%a0%87%e7%ad%be%e4%b8%ba%e5%8d%95%e4%bd%8d%e5%be%aa%e7%8e%af/#comment-216</link>

		<dc:creator><![CDATA[danielwang]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 01:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.mudbest.com/?p=752#comment-216</guid>

					<description><![CDATA[$clothes =array(
0=&gt;array(
&quot;休闲装&quot;,
&quot;休闲装2&quot;,
),
1=&gt;array(
&quot;休闲装&quot;,
&quot;休闲装2&quot;,
),
2=&gt;array(
&quot;西服1&quot;,
&quot;西服2&quot;,
),
3=&gt;array(
&quot;职业装&quot;,
&quot;职业装2&quot;,
),
);

array_walk ($clothes,&#039;display&#039;) ;
 function display($value, $key){
 if(is_array($value)){
 array_walk($value,&#039;display&#039;);
 }else{
 echo $value.”;
 }
 }
?&#062;
拙见！]]></description>
			<content:encoded><![CDATA[<p>$clothes =array(<br />
0=>array(<br />
&#8220;休闲装&#8221;,<br />
&#8220;休闲装2&#8221;,<br />
),<br />
1=>array(<br />
&#8220;休闲装&#8221;,<br />
&#8220;休闲装2&#8221;,<br />
),<br />
2=>array(<br />
&#8220;西服1&#8221;,<br />
&#8220;西服2&#8221;,<br />
),<br />
3=>array(<br />
&#8220;职业装&#8221;,<br />
&#8220;职业装2&#8221;,<br />
),<br />
);</p>
<p>array_walk ($clothes,&#8217;display&#8217;) ;<br />
 function display($value, $key){<br />
 if(is_array($value)){<br />
 array_walk($value,&#8217;display&#8217;);<br />
 }else{<br />
 echo $value.”;<br />
 }<br />
 }<br />
?&gt;<br />
拙见！</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
