fork(1) download
  1. <?php
  2.  
  3. $string = "8x2.1 3x2";
  4. preg_match_all('/\d+\.\d+/', $string, $matches);
  5. print_r($matches[0]);
Success #stdin #stdout 0.01s 83072KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 2.1
)