Goal
I'm looking for a way to str_replace variable content. So that I can change this:
...and in week 1 we saw that...
into this:
...and in <a href="/?w=1">week 1</a> we saw that...
Thoughts
I know how str_replace works and I could solve it by just running a hundred different queries, each with another week. But what I want is a query that looks for this:
'week ' + X
So a query that finds every string 'week ' that is followed by a number. Can anyone help me solve this? :)
Tx!
preg_replace()and then you can search for your:week \d+and replace it with what you want. (If you get stuck you can always post the code here and I will help you further :)