show_source

(PHP 4, PHP 5, PHP 7)

show_source别名 highlight_file()

说明

此函数是该函数的别名: highlight_file().

User Contributed Notes

kapten dot mozac at gmail dot com 02-Sep-2016 04:42
if show_source() won't work on your hosting, you can use file_get_contents()

<?php
   
echo "<pre>";
    echo
htmlentities(file_get_contents(__FILE__));
    echo
"</pre>";
?>

or combine it with highlight_string()

<?php
   
echo "<pre>";
    echo
htmlentities(highlight_string(file_get_contents(__FILE__)));
    echo
"</pre>";
?>
edy at edy-b dot de 20-May-2007 12:49
Show the source of the current file:

<?php
   
/* some code here */
   
   
show_source(__FILE__);   
?>