I'm getting more and more confused now.
Let me explain this is detail. I have a string of text. In that may be a string {NewsID:1367} that will be the syntax at least, the number will vary. There may also be multiple occurrences of this.
What I'm needing to do is replace this syntax with a URL. I also want to do a SQL query on the ID and return a couple of rows. Again the query is simple once I have the ID.
Essentially what I believe I need to do it loop through the original string of text. Find an occurrence of my syntax and replace it.
$str = "This is my original string of text, please refer to this news article {NewsID:343} or for more information read this article {NewsID:66447}.";
$ary = explode(' ', $str);
foreach($ary as $str){
/* check if my word is equal to the format i'm looking for. Extract the ID, do a query, get my rows. Replace the $str with formatted URL.*/
}
I guess I have no idea how to do the commented out stuff.