sections in it so I can write code easier (instead of now how I just replace tabs with 4 ).
It uses some regex expressions for the bbcode implementation part, so I figure I should add in the "code" parse in that same section. Anyway, Is there anyway in php to call a function with all the data in a certain part of a regex expression?
The regex patter would probably look like:
"'`\[code\](.+?)\[/code\]`is'"
And I want to be able to replace it with something like:
'some_custom_func(data_represented_by_the_[.+?]part_of_regex_expr)'
Is there a way to do this? Or some other way without having to iterate through the entire blog post?
Thanks.
Oh and since I'm on this topic, anyone recommend any code beautifiers that I can use for the "some_custom_func" part above?
php help: how to transform characters that are between certain tags?
Hello, I'm looking for some help with php code for my website. I have a blog, and I want to add
Quote:Original post by JohnBSmall
Not quite preg_replace:
preg_replace_callback()
John B
That looks perfect. Thanks.
@ Colin Jeane I'd love to read that but are you sure that's a valid link?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement