SEL.php

show_source



*** Neuer CronJob-Service bei SELFPHP verf�gbar ***
Informationsseite

nach unten Befehl
nach unten Version
nach unten Beschreibung
nach unten Beispiel
nach unten Ausgabe

nach unten 

Befehl

void show_source(string filename)

 

nach obennach unten 

Version

PHP 3, PHP 4

 

nach obennach unten 

Beschreibung

Mit show_source() kann man sich die Syntax einer PHP-Skriptdatei (filename)
farbig hervorheben und auf den Browser ausgeben lassen. Dabei werden als
Farben die in PHP eingebauten Syntax-Highlighter-Farben genutzt.
Hier im Buch sehen Sie in der Ausgabe nicht die farbige Syntaxmarkierung. Sie
können aber anhand des unten stehenden Quellcodes die Wirkungsweise der
Funktion nachvollziehen. Zusätzlich befindet sich auf der CD-ROM bei dem
Befehl show_source() die Ausgabe in farbiger Darstellung.

Siehe auch:

 

nach obennach unten 

Beispiel

/*Inhalt der Datei php.php:
<code><font color="#000000">
<font color="#0000CC">&lt;?PHP
<br></font><font color="#006600">echo&nbsp;</font> <font color="#0000CC">ini_get</font><font color="#006600">(</font> <font color="#CC0000">"highlight.string"</font><font color="#006600">);
<br>echo&nbsp;</font><font color="#CC0000">"&lt;br&gt;"</font> <font color="#006600">;
<br>echo&nbsp;</font><font color="#0000CC">ini_alter</font> <font color="#006600">(</font><font color="#CC0000">"highlight.string"</font> <font color="#006600">,</font><font color="#CC0000">"#DD00FF"</font> <font color="#006600">);
<br>echo&nbsp;</font><font color="#CC0000">"&lt;br&gt;"</font> <font color="#006600">;
<br>echo&nbsp;</font><font color="#0000CC">ini_get</font> <font color="#006600">(</font><font color="#CC0000">"highlight.string"</font> <font color="#006600">);
<br>echo&nbsp;</font><font color="#CC0000">"&lt;br&gt;"</font> <font color="#006600">;
<br>echo&nbsp;</font><font color="#0000CC">ini_get</font> <font color="#006600">(</font><font color="#CC0000">"highlight.comment"</font> <font color="#006600">);
<br>echo&nbsp;</font><font color="#CC0000">"&lt;br&gt;"</font> <font color="#006600">;
<br>echo&nbsp;</font><font color="#0000CC">ini_alter</font> <font color="#006600">(</font><font color="#CC0000">"highlight.comment"</font> <font color="#006600">,</font><font color="#CC0000">"#FF80DD"</font> <font color="#006600">);
<br>echo&nbsp;</font><font color="#CC0000">"&lt;br&gt;"</font> <font color="#006600">;
<br>echo&nbsp;</font><font color="#0000CC">ini_get</font> <font color="#006600">(</font><font color="#CC0000">"highlight.comment"</font> <font color="#006600">);
<br></font><font color="#0000CC">?&gt;</font>
</font>
</code>*/
<?PHP
show_source("php.php");
?>

 

nach obennach unten 

Ausgabe

<?PHP
echo ini_get("highlight.string");
echo 
"<br>";
echo 
ini_alter("highlight.string","#DD00FF");
echo 
"<br>";
echo 
ini_get("highlight.string");
echo 
"<br>";
echo 
ini_get("highlight.comment");
echo 
"<br>";
echo 
ini_alter("highlight.comment","#FF80DD");
echo 
"<br>";
echo 
ini_get("highlight.comment");
?>

 

nach oben
weiter:weiter Seite sleep
zurück:zurück Seite leak
 

© 2001, 2002, 2003, 2004, 2005 E-Mail , [email protected]