Hi!
Beim Rumprobieren hab ich eine kleine, aber nette Routine fürs Syntaxhighlighting geschaffen, sogar mit Zeinennummerierung:
<?php
if (isset ($_POST['los']))
{
$str = stripslashes($_POST['code']);
$str = explode("\n",$str);
foreach ($str as $line => $syntax)
{
echo "<br>".($line+1).": "; highlight_string($syntax);
}
}
else
{
?>
<form method="post">
<textarea name="code" cols=100 rows=20></textarea>
<input type="submit" name="los" value="Schow me!">
</form>
<?php
}
?>
Nützlich? Naja, weiß ich auch nicht, aber für die Scriptesammlung hier kann es doch nicht schaden, oder?