[php] bbcode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • something else
    replied
    i dont know where my post went to in this topic lol
    $1 is the same as \\1 just depends on what php editor you use
    also the " " at the start and end of the replacement need removing
    eg:
    PHP Code:
    $string preg_replace('#\[php\](.*?)\[\/php\]#se''<div>' highlight_string(stripslashes('$1'), true) . '</div>'$string);

    //some text here to get rid of opera bug and this forum :/ 
    you may also need to do string replacements on <br /> to ""
    and htmlspecialchars_decode() if you have already used htmlspecialchars()

    Originally posted by adex3g View Post
    $super="something else";
    echo "thank you $super";
    Added after 2 minutes:
    What can i use to prevent my post so not to hack by hacker with this bbcode
    Providing it is used properly then any html inserted into the [ php] tags should not get executed by the browser
    Last edited by metulj; 15.04.12, 07:12.

    Leave a comment:


  • adex3g
    replied
    $super="something else";
    echo "thank you $super";
    Added after 2 minutes:
    What can i use to prevent my post so not to hack by hacker with this bbcode
    Last edited by adex3g; 22.03.11, 15:13.

    Leave a comment:


  • subzero
    replied
    \\1
    PHP Code:
    $string preg_replace('#\[php\](.*?)\[\/php\]#se'"'<div>' . highlight_string(stripslashes('\\1'), true) . '</div>'"$string); 

    Leave a comment:


  • adex3g
    replied
    Originally posted by milomir View Post
    PHP Code:
    $string preg_replace('#\[php\](.*?)\[\/php\]#se'"'<div>' . highlight_string(stripslashes('$1'), true) . '</div>'"$string); 
    where $string is your input string (forum post for example)..
    not working

    Leave a comment:


  • adex3g
    replied
    Thanks you!

    Leave a comment:


  • milomir
    replied
    PHP Code:
    $string preg_replace('#\[php\](.*?)\[\/php\]#se'"'<div>' . highlight_string(stripslashes('$1'), true) . '</div>'"$string); 
    where $string is your input string (forum post for example)..

    Leave a comment:


  • adex3g
    started a topic [php] bbcode

    [php] bbcode

    Pls can any tell me how to do this bbcode
    [ php ] code here [ /php ]
Working...
X