Hello Readers ,
While doing web development many times we stuck with the concept of str_replace .
For understanding this, let's suppose we have one email template file stored in project directory and when we going to replace any string dynamically we will str_replace.
$file_output = file_get_contents("xyz.come/emails/my_email_template.php");
In that file we have one string call {NAME} and we want to replace that to dynamically coming Name so we will use str_replace that time.
$file_output=str_replace('{NAME}', 'foobar', $file_output);
So in this way we can replace any string in our template using str_replace.
0 Comment(s)