2013-02-04 81 views

回答

6

阵列格式这应做到:

<?php 
    $str = ''; 
    $str .= "Additional tax(2.34)"; 
    $str .= "Additional tax(3)"; 

    if (preg_match_all('/\((\d+(?:\.\d+)?)\)/', $str, $matches) > 0) { 
     var_dump($matches[1]); 
    } 
?> 
+0

感谢明亮的作品很多... :-)投票+1 – shyammtp