2013-02-04 116 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