PHP ~ highlight_string

Discussion in 'Web Design & Programming' started by Waffle, Dec 27, 2005.

  1. Waffle

    Waffle Alpha Geek

    Likes Received:
    38
    Trophy Points:
    0
    I'm trying to code up a bb code system with a code tag

    that produces

    PHP:
    <?php 

    $code 
    // that looks

    echo "like this";

    if (
    "there is an easy way"); {

    return(
    "to do this"); 

    }  

    ?>
    Please let me know?

    I've tried using highlight_string($tutorial) (this is the string that will contain bb code, that if [*code] tags are present, will be parsed to teh php colour system. However this doesn't work when I try it...it just echoes back actual script code as opposed to the intended string.


    Thanks
     
  2. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
  3. Waffle

    Waffle Alpha Geek

    Likes Received:
    38
    Trophy Points:
    0
    I haven't tested it yet but I'm thinking that that script will highlight the whole of the string, as opposed to just the code between the [*code] tags..unless I can modify my BB script?
     

Share This Page