fonction show_source PHP ()
Exemples
Fichier de test ( "test.php") étaient PHP coloration syntaxique:
<html>
<body>
<?php
show_source("test.php");
?>
</body>
</html>
<body>
<?php
show_source("test.php");
?>
</body>
</html>
Sortie du navigateur du code ci-dessus est la suivante (en fonction du contenu du document):
<html>
<body>
<?php
echo ( "test.php" );
?>
</body>
</html>
<body>
<?php
echo ( "test.php" );
?>
</body>
</html>
sortie HTML du code ci-dessus est la suivante (voir la source):
<html>
<body>
<code><span style="color: #000000">
<html>
<br /><body>
<br /><span style="color: #0000BB"><?php
<br /></span><span style="color: #007700">echo (</span><span style="color: #DD0000">"test.php"</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB">?>
<br /></span></body>
<br /></html></span>
</code>
</body>
</html>
<body>
<code><span style="color: #000000">
<html>
<br /><body>
<br /><span style="color: #0000BB"><?php
<br /></span><span style="color: #007700">echo (</span><span style="color: #DD0000">"test.php"</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB">?>
<br /></span></body>
<br /></html></span>
</code>
</body>
</html>
Exécution instance »
Définition et utilisation
fonction de la syntaxe fichier PHP surbrillance show_source (). Syntaxe mis en évidence à l'aide de balises HTML.
Couleur utilisée pour mettre en évidence le fichier php.ini peut être réglé ou en appelant ini_set ensemble de fonctions ().
show_source () est highlight_file () alias.
Remarque: Lorsque vous utilisez cette fonction, l'ensemble du dossier sera affiché, y compris les mots de passe et autres informations sensibles!
grammaire
show_source( filename,return )
参数 | 描述 |
---|---|
filename | 必需。规定要显示的文件。 |
return | 可选。如果该参数设置为 TRUE,该函数将以字符串形式返回高亮显示的代码,而不是直接进行输出。默认是 FALSE。 |
détails techniques
Retours: | Si le paramètre de retour est réglé sur TRUE, la fonction retournera une chaîne en surbrillance code, plutôt que directement sortie. Sinon, si les rendements réussis TRUE, en cas d'échec retourne FALSE. |
---|---|
PHP version: | 4+ |
Mise à jour de journal: | Depuis PHP 4.2.1 partir, cette fonction est maintenant affectée par safe_mode et open_basedir affectée. Cependant, en PHP 5.4 est supprimée dans safe_mode. Ajouté en PHP 4.2.0 Le paramètre de retour. |
Manuel PHP Divers Référence