Pardon my beginner-isms.
I have a text file as follows (shortened for sake of brevity):
Hello $user
Welcome to $place. Thank you for being member number $number.
Notice how it has a few variable in it.
I also have a PHP script as follows
function register ($user, $place, $number){
... SOME CODE HERE
$textmail = [PATH TO TEXT FILE SHOWN ABOVE];
mailer($email, $textmail)
}
I created a little function named "mailer" because the script is actually quite long and does a lot of mailing. So rather than repeat code... Why not a function..
The problem is that it doesn't process the text file and replace the variables with the appropriate content.
It leaves it as is...
Since mailer() is used for many things (ther than just this), I don't want to just pass the variables...
How can I have it take care of the text file, and just keep mailer() untouched?
I would assume there is a way to open the text file, and fill in the variables before we pass it to mailer().
Thanks.
I'm still learning this nifty language.