PHP code formatter on my website

Discussion in 'PHP' started by eamiro, Mar 28, 2009.

  1. #1
    I want to put some php code on my website, where I can find a free script that will format it (displaying it in colors like in a PHP editor)?
     
    eamiro, Mar 28, 2009 IP
  2. emed

    emed Peon

    Messages:
    70
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php
    highlight_string('<?php phpinfo(); ?>');
    //echo the formated text
    
    $formated = highlight_string('<?php phpinfo(); ?>',true);
    //save for later
    echo $formated;
    ?>
    PHP:
    http://www.php.net/highlight_string
     
    emed, Mar 28, 2009 IP
  3. eamiro

    eamiro Well-Known Member

    Messages:
    274
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #3
    Thanks for the help :)
     
    eamiro, Mar 28, 2009 IP