title: preg_replace or preg_match and how can i define it right
body: <p>This is my string:</p>
  
  <pre><code>$string =  "format,surcharge,amount,1,card,basicprice 3,50  F010F020,0%,3,50 ,,,";
  </code></pre>
  
  <p>and i want to have an array which should look like this:</p>
  
  <pre><code>array(
      0 =&gt; "format",
      1 =&gt; "surcharge",
      2 =&gt; "amount",
      3 =&gt; "1",
      4 =&gt; "card",
      5 =&gt; "basicprice",
      6 =&gt; "3,50",          //&lt;-- tricky part, i complete don't get how i can solve this
      7 =&gt; "card",
      8 =&gt; "F010",          //&lt;-- tricky part, i complete don't get how i can solve this   
      9 =&gt; "F020",          //&lt;-- tricky part, i complete don't get how i can solve this
      10 =&gt; "3,50",
  );
  </code></pre>
  
  <p>so my tries look like this:</p>
  
  <pre><code>$string =  "Format,Aufpreis,Anzahl,1,Card,Basispreis 3,50  F010F020,0%,3,50 ,,,,,,";
  $regEx = '/,/';
  $replace = ' ';
  $perfectArray = preg_replace('/,/', $replace, $string2);
  var_dump($perfectArray);
  </code></pre>
  
  <p>or like this </p>
  
  <pre><code>$array = str_split($string);
  
  $from = array(",", '"');
  $to = array(" ", " ");
  
      foreach ($array as $value)
      {
          $value = str_replace($from, $to, $string);
      }
      var_dump($value);
  </code></pre>
  
  <p>someone know how i can solve this? especially the "tricky part" (i put a comment in the code)</p>
  
  <p>would be very nice if someone can answer :)</p>