Jetzt herunterladen
 
 
 
 
 
 
  Sie sind hier: Startseite > Demo > Modul Demo > PHPcode Highlight  
 
 
 

Show PHP Code

Demonstration des Moduls Show PHP Code

Zum Download >>

Der folgende PHP Code ist mit diesem Modul optisch aufgewertet worden.

<?php
/**
 * Highlight f&uuml;r die Syntax eines Quelltextes, mit Zeilennummern.
 *
 * @param string $file
 * @param bool[optional] $return
 *
 * @return bool or string
 */
function highlight_file_numbered($file$return=false) {
    
$source highlight_file($file,1);
    
$source explode("<br />"$source);
    
$o "<ol>\r\n";
    if (!
$return) {
        echo 
$o;
        
$o '';
    }
    foreach (
$source as $line) {
        
$line trim($line,"\r\n");
        
$o .= "<li></li>\r\n";
        if (!
$return) {
            echo 
$o;
            
$o '';
        }
    }
    
$o .= "</ol>\r\n";
    if (!
$return) {
        echo 
$o;
        
$o true;
    }
    return 
$o;
}
?>

Diesen und viele weitere PHP-Code Schnipsel kann man auf phpfreaks.com finden.


 
 
 
© 2006 - 2012, WebsiteBaker-CMS.de ↑ Seitenanfang ↑
 

Kontakt | Impressum | Disclaimer


Günstiges CMS Hosting gibt es bei unserem Sponsor WSpace.org



Das CMS System Websitebaker ist unter der GNU General Public License veröffentlicht. Autor des System ist Ryan Djurovich.