2010-06-02 6 views

답변

2

어쩌면 간단한

$row = preg_replace('#(\d+)\s*\.\s*(\d+)#', '$1.$2', $row); 

충분할 수

$row = str_replace("/(?<=[0-9]+$)\s*[.]\s*(?=[0-9]+$)/", "", $row); 

그러나이 작동하지 않습니다 :이 같은 내다/lookbehind 주장에 노력하고있어?

0
$str = '50 .10, 50 . 10, 50. 10'; 
$str = preg_replace('/(\d+)\s*\.\s*(\d+)/', '$1.$2', $str); 
echo($str); // results in "50.10, 50.10, 50.10"