1
안녕하세요 저는 템플릿이 있습니다. db에서 가져오고 고객에게 이메일로 전송해야합니다. 그래서 나뭇 가지가 실제 변수를 값으로 쉽게 대체 할 수 있도록 [[]]을 {{}}로 바꾸고 싶습니다.html의 특수 문자를 작동하지 않는 다른 문자로 바꿉니다.
<p>Dear [[LOCATION_OWNER]],</p>\n
\n
<p><br />\n
We are exited [[LOCATION]]</p>\n
\n
<p>It is very early stages at the moment, and it may not get picked fromour selection, but we wanted to let you know.</p>\n
\n
<p>Here my contents</p>\n
\n
<p>Best wishes,</p>\n
\n
<p>[[CUSTOMER]]</p>
나는이 다음과 같은 방법을 시도하고있다 :
$patterns = array();
$patterns[0] = '/[[]]/';
$replacements = array();
$replacements[0] = '{{}}';
$output = preg_replace($patterns, $replacements, $getTemplates->getEmailTemplate());
을하지만 그것으로 [[]] 교체하지 {{}}. 이게 내가 누락 된 부분을 도와주세요. 내가 템플릿으로
감사