0
$str .= "Additional tax(2.34)";
$str .= "Additional tax(3)";
誰能幫我提取從字符串的數量。我需要這樣的
Array ([0] => 2.34 [1] => 3);
$str .= "Additional tax(2.34)";
$str .= "Additional tax(3)";
誰能幫我提取從字符串的數量。我需要這樣的
Array ([0] => 2.34 [1] => 3);
陣列格式這應做到:
<?php
$str = '';
$str .= "Additional tax(2.34)";
$str .= "Additional tax(3)";
if (preg_match_all('/\((\d+(?:\.\d+)?)\)/', $str, $matches) > 0) {
var_dump($matches[1]);
}
?>
感謝明亮的作品很多... :-)投票+1 – shyammtp