Welcome to the official GNU Netcat project homepage
The GNU Netcat project

Source of: /reserved/misc.inc

<?php
/* Part of http://netcat.sourceforge.net/ */

// Use class names instead of colors
ini_set('highlight.comment', 'comment');
ini_set('highlight.default', 'default');
ini_set('highlight.keyword', 'keyword');
ini_set('highlight.string''string');
ini_set('highlight.html',    'html');

// Highlight PHP code -- from http://www.php.net/include/layout.inc
function highlight_php($code, $return = FALSE)
{
   
// Using OB, as highlight_string() only supports
    // returning the result from 4.2.0
   
ob_start();
   
highlight_string($code);
   
$highlighted = ob_get_contents();
   
ob_end_clean();
   
   
// Fix output to use CSS classes and wrap well
   
$highlighted = '<div class="phpcode">' . str_replace(
        array(
           
'&nbsp;',
           
'<br>',
           
'<font color="',
           
'</font>',
           
"\n ",
           
'  '
       
),
        array(
           
' ',
           
"<br>\n",
           
'<span class="',
           
'</span>',
           
"\n&nbsp;",
           
'&nbsp; '
       
),
       
$highlighted
   
) . '</div>';

    if (
$return) { return $highlighted; }
    else { echo
$highlighted; }
}

You may also be interested in the following files, which complete the Netcat website:


Giovanni Giacobbi
E-Mail: My email address
This page was last updated on January, 23rd 2004


Main Menu
Home
News
Downloads

Project Summary
Report bugs
Browse SVN Repository

Show this page's source



Releases Status

Current Version:
Netcat 0.7.1


Released on:
11 Jan 2004



Supporters of Netcat

GloboTech Communications
dedicated server