<?php $string = "8x2.1 3x2";preg_match_all('/\d+\.\d+/', $string, $matches);print_r($matches[0]);
Standard input is empty
Array ( [0] => 2.1 )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!