-1

我尝试将突出显示文件写入文本区域,

<?php
    $hasil = highlight_file("test.php", true); 
    echo '<textarea type="text" name="code" rows="40" cols="120">'; 
    echo $hasil; 
    echo '</textarea>'; 
?>

如何删除textarea中生成的样式?

4

1 回答 1

0

Rather than removing the generated style just open the file normally and put it in the textarea

  <?php $hasil = file_get_contents("test.php"); 
  echo '<textarea type="text" name="code" rows="40" cols="120">'; 
  echo $hasil; 
  echo '</textarea>'; ?>

alternatively you can use strip_tags to remove all the styles from the highlighted output

于 2013-07-15T08:35:51.783 回答