Advertisement Jump to content
Sign in to follow this  

php help: how to transform characters that are between certain tags?

This topic is 4479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm looking for some help with php code for my website. I have a blog, and I want to add [ code ] [ /code ] 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?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!