Just wondering how to detect if a string contains certain tags, extract particular parts of that tag and then replace.
$string = 'abc [video width="640" height="360" mp4="video.mp4"][/video] def';
1. How do I detect if this string contains '*[video...[/video]*' (... meaning anything in between, * means anything on either side).
2. Then how to get the variables out of that string: so, width, height and mp4.
3. I can rewrite what i want for it to be (i'm sure you know where i'm going - to show the proper tags)
4. Then how to replace the new code with the old one.
Hope that makes sense.
Thanks in advance!