title: put comma after every number separated by space in matrix
body: <p>I need to transform this kind of string <code>matrix(1 0 0 1 961 3040.5)</code></p>
  
  <p>into <code>matrix(1, 0, 0, 1, 961, 3040.5)</code> with PHP</p>
  
  <p>I tried to get numbers only with <code>preg_replace</code> and then add commas with <code>str_split</code> but the problem is that with this approach I don't know where is the ending of a number to put comma in the right position.</p>
  
  <p>Any ideas?</p>