lwc Posted March 6, 2010 Share Posted March 6, 2010 If one wants to modify internal code segments before modifying external ones, there's a proof of concept of it in Example #3 of preg_replace_callback(). However, it only deals with just one tag. Can you think of a way to expand it to multiple tags? Also, not with BB code but actual <custom code>. For example, $input = "Hi, this is <custom_code1>just <custom_code2>my</custom_code2> <custom_code3>example</custom_code3></custom_code1>. How can it <custom_code4>get <custom_code5>done</custom_code5></custom_code4>?"; Another function does different things for what's inside each of the custom codes. Basically codes 2 & 3 need to run before code 1 can, and code 4 needs to run before code 5 can. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/194300-using-recursive-structure-to-handle-encapsulated-code/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.