2024-10-11 19:39:45
<?php
$s = '<div class="price f12 c-e1">
¥219.89
</div>
<div class="serLine f12 c6">|</div>
<div class="f12 c6 unit">4台起</div>';
$s = preg_match_all('/<div class="price f12 c-e1">.*([\d\.]+?).*<\/div>/sU' , $s , $out);
print_r($out);
结果:
Array
(
[0] => Array
(
[0] => <div class="price f12 c-e1">
¥219.89
</div>
)
[1] => Array
(
[0] => 219.89
)
)
已测试 , 望采纳