clear string from commas and put it into array
<p>I want clear all commas from string and then put all words separated with comma into array.</p>

<p>For me it's easy to make it in the case i have this type of string:</p>

<pre><code>word1,word2,word3,word4,word5,word6
</code></pre>

<p>I have juste to explode them and put them into array like this:</p>

<pre><code>$words = "word1,word2,word3,word4,word5,word6";
$explode = explode(",", $words);

$array = array();
foreach($explode as $word) {
  $array[] = $word;
}
</code></pre>

<p>And here come my need: 
In the case i have this kind of string what is the approch ?</p>

<pre><code>word1,,word2,,,word3,word4,,,,,,,,,,,,word5,,,,word6...
</code></pre>

<p>The number of commas between words undefined and can be up to 100 commas.</p>

<p>Let me know if u have good approch to this kind of string.</p>