Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder funnymoney's Avatar
    Join Date
    Aug 2007
    Posts
    364
    Thanks
    17
    Thanked 24 Times in 24 Posts

    Regular BBCode Help..

    I'm trying to fix this old BBCode script to work something better, but something just doesn't go right..

    preg_match_all('/(\[php])(.+?)(\[\/php])/', stripslashes($tekst), $matches);

    gives this results,

    PHP Code:
    Array
    (
        [0] => Array
            (
                [0] => [php ]<?php echo 'hello world1';  ?>[/php ]
                [1] => [php ]<?php echo 'hello world2';  ?>[/php ]
                [2] => [php ]<?php echo 'hello world3';  ?>[/php ]
            )

        [1] => Array
            (
                [0] => [php ]
                [1] => [php ]
                [2] => [php ]
            )

        [2] => Array
            (
                [0] => <?php echo 'hello world1';  ?>
                [1] => <?php echo 'hello world2';  ?>
                [2] => <?php echo 'hello world3';  ?>
            )

        [3] => Array
            (
                [0] => [/php ]
                [1] => [/php ]
                [2] => [/php ]
            )

    )
    and i would like to ommit [ php ] and [ /php ] from searches. i tried different regex but just can't figure it out..
    Last edited by funnymoney; 09-08-2009 at 07:45 AM.

  • #2
    Regular Coder funnymoney's Avatar
    Join Date
    Aug 2007
    Posts
    364
    Thanks
    17
    Thanked 24 Times in 24 Posts
    can i bump this...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •