PHP抓取数值
原来可用,失效了运行完数值0.0031,会的帮忙修改下,谢谢。<?php
$arr = file("https://www.huilv.cc/JPY_CNY/");
if($arr){
preg_match("@<div class=dollar_two><span class=back>(.*?)</span></div><div class=clear></div><div class=@si",$arr, $regs);
$a = $regs;
$b = $a+0.0031;
echo $b ;
$content = " var rate = $b;
document.writeln('$b');";
file_put_contents("ka.js",$content);
}
?> <?php
$data = file_get_contents("https://www.huilv.cc/JPY_CNY/");
if($data){
preg_match("/<div class=dollar_two><span class=back>(.*)<\/span><\/div><div class=clear><\/div>/isU", $data, $regs);
$a = $regs;
$b = $a+0.0031;
echo $b ;
$content = " var rate = $b;
document.writeln('$b');";
file_put_contents("ka.js",$content);
}
?> 把代码里面的
$arr
改为:
$arr sinob 发表于 2021-5-3 12:10
把代码里面的
改为:
改了,还是不行 $content = " var rate = $b; :o:o:o:o:o:o:o
页:
[1]