PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
instead of just giving you the answer, I'm going to nudge you in the direction of at least 1 solution..
using the regular expression replacement functions, you can capture the substring you wish.. then call the same function again with a different pattern and replacement to convert the original string into a receptical for the substring.
it's not possible with the substr function by itself, without exacting knowledge of the composition of the string.. you'd need to either analyze the string to see where the tag(s) start and end to find the 5 contained characters, or do as I did for the solution, use regex to just pull the data out of the string.. the solution I cooked up is fairly simple..