I'm working on a social networking site. When sending a notification, you for example could type [user:20:name] in the notification as a developer in the text you send. So say i send
"[user:20:name] commented on your [video:8:name,link] video"
it would show up as "Bob commented on your iOS 5 review video".
So it would see user, see the user id and that i wanted the name, it would then do the work in the database it needs and replace [user:20:name] in the string with Bob.
For the video it would know i wanted the name for video 8 as a link. How would i parse something like this? I already know how to grab data from the database. Just stuck on this part. Any idea how?
One of the idea was to get each [markup] by its self, and do the parsing on each one, then str_replace it when i get the processed version of the markup.
Not sure how i would get each [markup] by it self.