Jump to content
×
×
  • Create New...

Créer son BBCode


Bullllet58
 Share

Recommended Posts

voici mon script pour créer son BBcode

// Creer son BBcode
       $simple_search = array(
                               '/\[b\](.*?)\[\/b\]/is',
                               '/\[i\](.*?)\[\/i\]/is',
                               '/\[u\](.*?)\[\/u\]/is',
                               '/\[s\](.*?)\[\/s\]/is',
                               '/\[quote\](.*?)\[\/quote\]/is',
                               '/\[link\=(.*?)\](.*?)\[\/link\]/is',
                               '/\[url\=(.*?)\](.*?)\[\/url\]/is',
                               '/\[color\=(.*?)\](.*?)\[\/color\]/is',
                               '/\[size=small\](.*?)\[\/size\]/is',
                               '/\[size=large\](.*?)\[\/size\]/is',
                               '/\[code\](.*?)\[\/code\]/is',
                               );

       $simple_replace = array(
                               '$1',
                               '$1',
                               '$1',
                               '$1',
                               "$1",
                               "$2",
                               "$2",
                               "$2",
                               "$1",
                               "$1",
                               '$1',
                               );

       $str = preg_replace ($simple_search, $simple_replace, $str);

       return $str;

 

à vous d'en faire ce que vous voulez ;)

 

 

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share



Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.