Php 如何在没有代码的情况下从html文件中回送随机行?
我必须从一个html文件中呼出随机的行。我的代码工作到目前为止,我回显了一个特定的随机数行,但问题是我回显了html代码,而不是html网站上出现的文本。如何解决这个问题Php 如何在没有代码的情况下从html文件中回送随机行?,php,html,Php,Html,我必须从一个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(
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>";
}
}
在这里:
例:
你能把不需要的输出添加到帖子中吗?如果你一直在回显,代码很难读懂。对你下一步要回显的所有行进行批量回显,然后你可以在不改变任何内容的情况下同时回显变量。所需输出的示例也会很有帮助。我在上面解释了我想要的内容。我将如何实现这一点。我甚至尝试创建一个变量,比如$Script=include$folder.'/'.$file.'/Romeo And Juliet Script.htm“stript_标记没有帮助。我自己已经试过了。你能给我一些建议吗?根据您添加的输出,它看起来不像html,更像css。
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.
$str = strip_tags($input);