Jump to content
  • Advertisement
Sign in to follow this  
IFooBar

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

This topic is 4387 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!