為什么截取不到字符串;<?php$url = "https://www.xe.com/zh-CN/currencyconverter/convert/?Amount=$Amount&From=$from&To=$to";
$content =file_get_contents($url);
$regex4 = "/<span\sclass=\"uccResultAmount\">(.*?)<\/span>/i";
preg_match_all($regex4, $content, $matches);
var_dump($matches);die;?>代碼圖如下:我得到的結果:正常來說應該可以獲取到的,一直沒結果!
php函數preg_match_all()正則匹配html結構問題!
當年話下
2018-07-05 15:10:28