Php 我需要把pre标签的滚动条放在内容行中
我有上千行的文本文件,我想制作一个php页面,在那里我可以看到它们,并在我想要的地方打开它。我的意思是,滚动条必须在我想要的行中。文件在pre标记上完全打开,但滚动条必须在“N”行中 这将使用php打开文件:Php 我需要把pre标签的滚动条放在内容行中,php,html,Php,Html,我有上千行的文本文件,我想制作一个php页面,在那里我可以看到它们,并在我想要的地方打开它。我的意思是,滚动条必须在我想要的行中。文件在pre标记上完全打开,但滚动条必须在“N”行中 这将使用php打开文件: echo "<pre >"; $file = $pathOfFile; $contents = file_get_contents($file); $lines = explode("<br>", $contents); // this is your ar
echo "<pre >";
$file = $pathOfFile;
$contents = file_get_contents($file);
$lines = explode("<br>", $contents); // this is your array of words
foreach($lines as $word)
echo $word;
echo"</pre>";
<pre>
<a name="0"></a>Line 1<br>
<a name="1"></a>Line 2<br>
<a name="2"></a>Line 3</br>
...
<a name="500"></a>Line 500
</pre>
echo”“;
$file=$pathOfFile;
$contents=file\u get\u contents($file);
$lines=分解(“
”,$contents);//这是你的单词数组
foreach($word形式的行)
回声$字;
回声“;
我的建议是在每个条目前面加上锚定标签:
echo '<pr>';
$file = $pathOfFile;
$contents = $file_get_contents($file);
$lines = explode('<br>', $contents);
$i = 0;
foreach($lines as $word)
{
echo '<a name="' . $i . '"></a>' . $word . '<br>';
++$i;
}
echo '</pre>';
echo';
$file=$pathOfFile;
$contents=$file\u get\u contents($file);
$lines=分解(“
”,$contents);
$i=0;
foreach($word形式的行)
{
回声'