about php... how to convert string to array then show out?
<p>i have this string - </p>

<pre><code>$result = "ABCDE";
</code></pre>

<p>and i want to seperate them to 3 parts</p>

<pre><code>(like part 1 = A, part 2 = B, part 3 = C..., part 5 = E)
</code></pre>

<p>,give a name to each of them</p>

<pre><code>part 1(A) = Apple
part 2(B) = Orange
part 3(C) = Ice-cream
part 3(D) = Water
part 5(E) = Cow
</code></pre>

<p>then the finally output is like</p>

<p>Output : You choose Apple, Orange, Ice-cream, Water, Cow</p>

<p>or like this  </p>

<pre><code>$result = "ACE";
</code></pre>

<p>Output : You choose Apple, Ice-cream, Cow</p>

<p>i have tried using array</p>

<pre><code>$result = "ABCDE";
$showing = array(A =&gt; 'Apple , ', B =&gt; 'Orange , ', C =&gt; 'Ice-cream , ',
 D =&gt; 'Water , ', E =&gt; 'Cow , ');
echo  $showing[$result];
</code></pre>

<p>but i got nothing while output, seems array is not working in fixed string.</p>

<p>i want to know how to do it</p>
