PHP decrementation boucle
<p>I have a string variable like this :  <code>'1111/222/333'</code> or <code>'1111/222/333/444'</code> </p>

<p>and i want to get an Array like this : </p>

<pre><code>111-222-3333
111-222-
111-
</code></pre>

<p>OR </p>

<pre><code>1111-222-333-444
1111-222-333-
1111-222-
1111-
</code></pre>

<p>I have tried with <code>$pieces = explode("/", $str);</code></p>

<p>and :</p>

<pre><code>$str = '1111/222/333/444';
$pieces = explode("/", $str);
for($i=0; $i&lt;count($pieces); $i++) {

    $var .= $pieces[$i]."-".$pieces[$i+1];
    echo $i." - ".$var."&lt;br&gt;";  

}
</code></pre>

<p>but I haven't get the good result! </p>

<p>Any help ? </p>
