aktuelle.kurse/oldies/m133/4_Modulinhalte_und_Uebungen/00-Anwendungen-Beispiele-Uebungen/PHP_Referenz/funktionsreferenz/sonstige_funktionen/show_source.html

204 lines
13 KiB
HTML
Raw Normal View History

2022-03-17 11:19:26 +01:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>show_source</title>
<link rel="stylesheet" type="text/css" href="../../src/self.css">
<meta name="description" content="Hebt den Syntax einer Datei farbig hervor">
<meta name="keywords" content="SELFPHP, PHP, Sonstige-Funktionen, show_source">
<meta name="author" content="Damir Enseleit, mail@selfphp.info">
<meta name="DC.Contributer" content="Matthias Hupp, m.hupp@selfphp3.de">
<meta name="DC.Publisher" content="Damir Enseleit, mail@selfphp.info">
<meta name="DC.Date" content="2001-08-22T12:18+01:00">
<meta name="DC.Identifier" content="http://www.selfphp3.de/funktionsreferenz/sonstige_funktionen/show_source.html">
<meta name="DC.Language" content="de">
<meta name="DC.Rights" content="../../editorial/index.html">
<meta name="SELF.Firstdate" content="2001-08-22T12:18+01:00">
<meta name="SELF.Version" content="1">
<meta name="SELF.Pagetype" content="Information">
<meta name="SELF.Path" content="SELFPHP == ../../index.php // Funktionsreferenz == ../index.php // Sonstige-Funktionen == index.html">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#AA5522" vlink="#772200" alink="#000000">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#FFEEDD" class="nav"><a class="an" name="top"><img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"></a> <a href="../../index.html"><b>SELFPHP</b></a>/<a href="../../navigation/index.html">Navigationshilfen</a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"> <a href="../index.html"><b>Funktionsreferenz</b></a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"> <a href="index.html"><b>Sonstige-Funktionen</b></a></td>
</tr>
</table><table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#EEEEEE" class="doc" width="110"><img src="../../src/logo.gif" width="106" height="109" border="0" alt="SEL.html"></td>
<td bgcolor="#EEEEEE" class="doc" valign="bottom" width="100%">
<h2>show_source</h2>
<tr>
<td bgcolor="#EEEEEE" class="doc" valign="top" align="center">
<img src="../../src/dokx.gif" width="30" height="20" vspace="6" border="0" alt="Informationsseite">
</td>
<td bgcolor="#FFFFFF" valign="top" nowrap>
<p>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#befehl"><b>Befehl</b></a><br>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#version"><b>Version</b></a><br>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#beschreibung"><b>Beschreibung</b></a><br>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#beispiel"><b>Beispiel</b></a><br>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#ausgabe"><b>Ausgabe</b></a><br>
</p>
</td>
</tr><tr><td colspan=2 bgcolor="#EEEEEE" class="doc"><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;</td></tr>
</table>
<h2 class="Sh2"><a class="an" name="befehl">Befehl</a></h2>
<table width="100%" cellpadding=10><tr>
<td class="xmpcode" bgcolor="#E4EEFF">void <b>show_source</b>(string filename)</td>
</tr></table>
<p>&nbsp;</p>
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;
</td></tr></table>
<h2 class="Sh2"><a class="an" name="version">Version</a></h2>
<table width="100%" cellpadding=10 height="32">
<tr>
<td class="xmpcode" bgcolor="#E4EEFF" height="20">
<p>PHP 3, PHP 4</p>
</td>
</tr></table>
<p>&nbsp;</p>
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;
</td></tr></table>
<h2 class="Sh2"><a class="an" name="beschreibung">Beschreibung</a></h2>
<table width="100%" cellpadding=10 height="145">
<tr>
<td class="xmpcode" bgcolor="#E4EEFF" height="57">
<p>Mit show_source() kann man sich die Syntax einer PHP-Skriptdatei (filename)<br>
farbig hervorheben und auf den Browser ausgeben lassen. Dabei werden als<br>
Farben die in PHP eingebauten Syntax-Highlighter-Farben genutzt.<br>
Hier im Buch sehen Sie in der Ausgabe nicht die farbige Syntaxmarkierung.
Sie<br>
k&ouml;nnen aber anhand des unten stehenden Quellcodes die Wirkungsweise
der<br>
Funktion nachvollziehen. Zus&auml;tzlich befindet sich auf der CD-ROM
bei dem<br>
Befehl show_source() die Ausgabe in farbiger Darstellung.</p>
<p>Siehe auch:</p>
<ul>
<li><a href="highlight_string.html">highlight_string()</a></li>
<li><a href="highlight_file.html">highlight_file()</a></li>
</ul>
</td>
</tr></table>
<p>&nbsp;</p>
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;
</td></tr></table>
<h2 class="Sh2"><a class="an" name="beispiel">Beispiel</a></h2>
<table width="100%" cellpadding=10 height="66">
<tr>
<td class="xmpcode" bgcolor="#E4EEFF">
<pre>/*Inhalt der Datei php.php:
&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;<br>&lt;font color=&quot;#0000CC&quot;&gt;&amp;lt;?PHP<br>&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;echo&amp;nbsp;&lt;/font&gt;
&lt;font color=&quot;#0000CC&quot;&gt;ini_get&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;
&lt;font color=&quot;#CC0000&quot;&gt;&quot;highlight.string&quot;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;);<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;&amp;lt;br&amp;gt;&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;;<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;ini_alter&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;highlight.string&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;,&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;#DD00FF&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;);<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;&amp;lt;br&amp;gt;&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;;<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;ini_get&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;highlight.string&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;);<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;&amp;lt;br&amp;gt;&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;;<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;ini_get&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;highlight.comment&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;);<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;&amp;lt;br&amp;gt;&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;;<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;ini_alter&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;highlight.comment&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;,&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;#FF80DD&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;);<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;&amp;lt;br&amp;gt;&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;;<br>&lt;br&gt;echo&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;ini_get&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;highlight.comment&quot;&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;);<br>&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;?&amp;gt;&lt;/font&gt;<br>&lt;/font&gt;<br>&lt;/code&gt;*/<br>
&lt;?PHP<br>show_source(&quot;php.php&quot;);<br>?&gt;</pre>
<p></p>
</td>
</tr></table>
<p>&nbsp;</p>
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;
</td></tr></table>
<h2 class="Sh2"><a class="an" name="ausgabe">Ausgabe</a></h2>
<table width="100%" cellpadding=10 height="45">
<tr>
<td class="xmpcode" bgcolor="#E4EEFF" height="57">
<p><font color="#000000"> <font color="#000000"> <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>
</font></font></p>
</td>
</tr></table>
<p>&nbsp;</p>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr><td colspan=2 bgcolor="#EEEEEE" class="doc">
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a>
</td></tr>
<tr>
<td bgcolor="#EEEEEE" class="doc" align="right" width="110">weiter:<a href="sleep.html"><img src="../../src/next.gif" width="10" height="10" border="0" hspace="10" alt="weiter"></a></td>
<td bgcolor="#FFFFFF"><img src="../../src/dok.gif" width="15" height="10" border="0" alt="Seite">
<a href="sleep.html"><b>sleep</b></a> </td>
</tr>
<tr>
<td bgcolor="#EEEEEE" class="doc" align="right" width="110">zur&uuml;ck:<a href="leak.html"><img src="../../src/prev.gif" width="10" height="10" border="0" hspace="10" alt="zur&uuml;ck"></a></td>
<td bgcolor="#FFFFFF" width="100%"><img src="../../src/dok.gif" width="15" height="10" border="0" alt="Seite">
<a href="leak.html"><b>leak</b></a> </td>
</tr>
<tr><td colspan=2 bgcolor="#EEEEEE" class="doc">&#160;</td></tr>
</table><table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#FFEEDD" class="nav"><a class="an" name="bottom"><img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"></a>
<a href="../../index.html"><b>SELFPHP</b></a>/<a href="../../navigation/index.html">Navigationshilfen</a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von">
<a href="../index.html"><b>Funktionsreferenz</b></a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von">
<a href="index.html"><b>Sonstige-Funktionen</b></a></td>
</tr>
</table>
<p><a class="an" name="bottom">&copy; 2001, 2002, 2003</A> <img src="../../src/mail.gif" width="15" height="10" border="0" alt="E-Mail">&nbsp;<a href="mailto:mail@selfphp.info">Damir Enseleit, mail@selfphp.info</a></p>
</body>
</html>