Simple search and replace function issue
Posted: Tue Nov 25, 2008 1:20 pm
Not so much a question, but i need to know which php function can be used to process this type of string:
lets say i have a URL, echoed within the html on a php page,
but at the end of the URL is a id
http://www.yourdomain.com/?id=123456
the idea is im going to write it like this with the curly brackets
http://www.yourdomain.com/?id={userid}
so, there wont be any specific user id,
The question is which, php function, can search all the {userid} part of the URLS contained within a page , and replace it with a . $row['userid'] . or any other variable from a database of my choosing?
Basically, i just need to replace the whole {userid} including the curly brackets into something else... thanks in advance.
lets say i have a URL, echoed within the html on a php page,
but at the end of the URL is a id
http://www.yourdomain.com/?id=123456
the idea is im going to write it like this with the curly brackets
http://www.yourdomain.com/?id={userid}
so, there wont be any specific user id,
The question is which, php function, can search all the {userid} part of the URLS contained within a page , and replace it with a . $row['userid'] . or any other variable from a database of my choosing?
Basically, i just need to replace the whole {userid} including the curly brackets into something else... thanks in advance.