<?php $str = '12.345678,23.45678901'; preg_match('/^(\d+\.\d{3})\d*,(\d+\.\d{2})\d*$/', $str, $matches); echo "first number: {$matches[1]}\nsecond number: {$matches[2]}\n"; preg_match_all('/(?<=^)\d+\.\d{3}(?=\d*,)|(?<=,)\d+\.\d{2}(?=\d*$)/', $str, $matches); echo "first number: {$matches[0][0]}\nsecond number: {$matches[0][1]}\n";
You have javascript disabled. You will not be able to edit any code.