我必须回应html文件中的随机行。我的代码到目前为止工作,我回显了一个特定的随机数行,但问题是我回应了html代码,而不是html网站上出现的文本。如何解决这个问题?
My code:
foreach($files as $file) {
if($file === '.' OR $file === '..' OR $file === 'thumbs.db' OR !is_dir($folder.'/'.$file)) {continue;}
if(file_exists($folder.'/'.$file.'/doubleindemnity.gif') AND file_exists($folder.'/'.$file.'/DOUBLEINDEMNITY.htm')) {
echo "<img src='$folder/$file/doubleindemnity.gif'>";
$lines = file($folder.'/'.$file.'/DOUBLEINDEMNITY.htm');
for($x = 1;$x<=15;$x++) {
echo $lines[rand(0, count($lines)-1)]."<br>";
}
echo "</div>";
}
}
目前我回应了这样的事情:
MSO的比迪-字体家庭:快递; MSO的ANSI-语言:DE'&GT;
坎布里亚; MSO的比迪-字体家庭:坎布里亚; MSO的ANSI-语言:DE'&GT;
MSO的比迪-字体家庭:快递; MSO的ANSI-语言:DE'&GT;
MSO的比迪-字体家庭:快递; MSO的ANSI-语言:DE'&GT;
DE'&GT;
我想要的是这样的:
A-1 LOS ANGELES - 市中心交叉
It is night, about two o'clock, very light traffic.
At the left and in the immediate foreground a semaphore
traffic signal stands at GO. Approaching it at about thirty
miles per hour is a Dodge 1938 coupe. It is driven erratically
and weaving a little, but not out of control.