title: Parse formatted strings containing 3 delimiters to create multiple flat arrays
body: <p>I have strings in following format:</p>
  <pre><code>$strings[1] = cat:others;id:4,9,13
  $strings[2] = id:4,9,13;cat:electric-products
  $strings[3] = id:4,9,13;cat:foods;
  $strings[4] = cat:drinks,foods;
  </code></pre>
  <p>where <code>cat</code> means category and <code>id</code> is identity number of a product.</p>
  <p>I want to split these strings and convert into arrays <code>$cats = array('others');</code> and <code>$ids = array('4','9','13');</code></p>
  <p>I know that it can be done by foreach and explode function through multiple steps. I think I am somewhere near, but the following code does not work.</p>
  <p>Also, I wonder if it can be done by <code>preg_match</code> or <code>preg_split</code> in fewer steps. Or any other simpler method.</p>
  <pre><code>foreach ($strings as $key=&gt;$string) {
     $temps = explode(';', $string);
     foreach($temps as $temp) {
        $tempnest = explode(':', $temp);
        $array[$tempnest[0]] .= explode(',', $tempnest[1]);
     }
  }
  </code></pre>
  <p>My desired result should be:</p>
  <pre><code>$cats = ['others', 'electric-products', 'foods', 'drinks';
  </code></pre>
  <p>and</p>
  <pre><code>$ids = ['4','9','13'];
  </code></pre>