...

View Full Version : Regular BBCode Help..



funnymoney
09-08-2009, 08:42 AM
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,



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..

funnymoney
09-10-2009, 02:55 AM
can i bump this...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum