我有我想要全部打印出來的foreach循環,但只獲得第一個字符以下的preg_match_all
Array ([0] => Array ([0] => $9.70 [1] => $10 [2] => $11.95 [3] => $0.49 [4] => $2.95 [5] => $2.95 [6] => $2.95 [7] => $2.95 [8] => $0.49 [9] => $9.70))
的結果。
這裏就是我想:
$i = '0';
foreach ($matches[0] as $val) {
echo $val[$i].'<br />';
$i++;
}
我要去哪裏錯了?
謝謝,但多數民衆贊成在錯 - 應該是$匹配[0] –