由于 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 ) )
我试图在 foreach 循环中打印它们,但只得到第一个字符。
这是我正在尝试的:
$i = '0';
foreach ($matches[0] as $val) {
echo $val[$i].'<br />';
$i++;
}
我哪里错了?