I am trying to make a form letter using PHP. I have a view that has a text area that has some pre-populated text. The text is like a letter: Dear So-and-so, etc.
There are a few places that I need to fill in specific, dynamic data from the db, but otherwise I need to let the user change the wording of the other parts of the email as necessary. I am thinking of putting a random character sequence to mark each place I am going to insert a new value.
So I submit the form to a PHP page and I pull the text out into a string variable. As I get ready to email it off I need to make sure that those placeholders are updated. How can I replace the contents of the string variable with the value of a variable?
EDIT – Example. This is what I currently have inside of the string variable in the PHP file that is processing the action of the form.
Hi %@
I hope you are doing well. I wanted to remind you that in %@ days you need to do something.
As a team we are currently at %@ percent.
What I use to do is something like as follows.
I hope this will make pretty much clear that, how you can work this out.