<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — Help me Obi Wan...]]></title>
		<link>https://punbb.informer.com/forums/topic/3688/help-me-obi-wan/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/3688/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Help me Obi Wan....]]></description>
		<lastBuildDate>Sun, 25 Apr 2004 14:37:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Help me Obi Wan...]]></title>
			<link>https://punbb.informer.com/forums/post/12846/#p12846</link>
			<description><![CDATA[<p>Yes, I solved it like this:</p><div class="codebox"><pre><code>$a = array(&#039;apples&#039;, &#039;oranges&#039;);
$b = array(&#039;apples&#039; =&gt; 4, &#039;bananas&#039; =&gt; 2, &#039;oranges&#039; =&gt; 12, &#039;grapes&#039; =&gt; 1);

while (list($key, $value) = @each($b))
{
    if (in_array($key, $a))
        $c[$key] = $value;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Sun, 25 Apr 2004 14:37:05 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/12846/#p12846</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help me Obi Wan...]]></title>
			<link>https://punbb.informer.com/forums/post/12844/#p12844</link>
			<description><![CDATA[<div class="quotebox"><cite>Rickard wrote:</cite><blockquote><p>I&#039;m afraid not :D</p><p>Try setting the same quantity for more than one element. E.g. set bananas to 4.</p></blockquote></div><p>Bah! Ruining my nice solution :P</p><p>Seems like a hard problem to solve... you can&#039;t create the arrays different or something like that instead? Seems like a <em>foreach</em> is the best solution otherwice...</p>]]></description>
			<author><![CDATA[null@example.com (Chacmool)]]></author>
			<pubDate>Sun, 25 Apr 2004 13:34:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/12844/#p12844</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help me Obi Wan...]]></title>
			<link>https://punbb.informer.com/forums/post/12843/#p12843</link>
			<description><![CDATA[<p>$c = $b? :D</p>]]></description>
			<author><![CDATA[null@example.com (Jansson)]]></author>
			<pubDate>Sun, 25 Apr 2004 13:31:51 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/12843/#p12843</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help me Obi Wan...]]></title>
			<link>https://punbb.informer.com/forums/post/12813/#p12813</link>
			<description><![CDATA[<p>I&#039;m afraid not :D</p><p>Try setting the same quantity for more than one element. E.g. set bananas to 4.</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Sun, 25 Apr 2004 00:35:14 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/12813/#p12813</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help me Obi Wan...]]></title>
			<link>https://punbb.informer.com/forums/post/12812/#p12812</link>
			<description><![CDATA[<p>YES! Finally :D</p><p>It took half an hour, but we got it! Hopefully not too complex:<br /></p><div class="codebox"><pre><code>array_flip(array_intersect(array_flip($b), ($a)));

Array
(
    [apples] =&gt; 4
    [oranges] =&gt; 12
)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Chacmool)]]></author>
			<pubDate>Sun, 25 Apr 2004 00:31:47 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/12812/#p12812</guid>
		</item>
		<item>
			<title><![CDATA[Help me Obi Wan...]]></title>
			<link>https://punbb.informer.com/forums/post/12807/#p12807</link>
			<description><![CDATA[<p>Gah! I&#039;m either very tired of just plain stupid. I can&#039;t figure this thing out. I have an array $a containing a list of fruits:</p><p>$a = array(&#039;apples&#039;, &#039;oranges&#039;);</p><p>I also have an array $b containing a list of fruits and their quantities:</p><p>$b = array(&#039;apples&#039; =&gt; 4, &#039;bananas&#039; =&gt; 2, &#039;oranges&#039; =&gt; 12, &#039;grapes&#039; =&gt; 1);</p><p>Now I want to construct a third array $c that is the intersection of $a and $b based on values from $a and keys from $b. I.e. I want to do something like this:</p><p>$c = cool_mix_of_php_array_functions($a, $b);</p><p>and get: array(&#039;apples&#039; =&gt; 4, &#039;oranges&#039; =&gt; 12);</p><p>Anyone?</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Sat, 24 Apr 2004 22:43:45 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/12807/#p12807</guid>
		</item>
	</channel>
</rss>
