PHP numeric for each with substr_count
<p>Okay let me simplify..</p>

<p>I have a list of ids in a variable <code>$paramsId = 10,38,8,4,36,</code>..
I now need to separate these numbers into separate variables so i used <code>list($slide1, $slide2, $slide3, $slide4, $slide5) = explode(",", $params-&gt;get('id'));</code>
then i placed it in a array:</p>

<pre><code>$a = array(
    "one" =&gt; $slide1,
    "two" =&gt; $slide2,
    "three" =&gt; $slide3,
    "four" =&gt; $slide4,
    "five" =&gt; $slide5
);
</code></pre>

<p>and then it gets put into a foreach statement:</p>

<pre><code>foreach ($a as $k =&gt; $val) {
    $args = $val;
    $item[] = ModArticleSlider::getArticles($args);
}
</code></pre>

<p>all i am trying to achieve is that foreach number in $paramsId separate the values with a "," and then place each seperated value into variables named "$slider1, $slider2(and so forth)" then place those variables in an array.</p>

<p>Any Help Greatly Appreciated.</p>
