Last active
June 4, 2024 19:01
-
-
Save iNamik/4147047 to your computer and use it in GitHub Desktop.
Simple PHP Function to Replace Tags in a String (i.e. "Hello, {{there}}" => "Hello, world")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ExeQue wrote:
Thanks for the suggestion - I've updated the regex but with a slightly different take - My update doesn't expect or allow
\s
to exist in the tag name.Thats good advice, but I think there's a general consensus that the
mb_
functions are slower, so I decided to just add a comment for the user to decide if the change makes sense for their use case.Thanks! Its fun to see this gist still getting used so long after I created it !