I am trying to replace some characters in a text block. All of the replacements are working except the one at the beginning of the string variable.
The text block contains:
[FIRST_NAME] [LAST_NAME]
, This message is to inform you that...
The variables are defined as:
$fname = "John";
$lname = "Doe";
$messagebody = str_replace('[FIRST_NAME]',$fname,$messagebody);
$messagebody = str_replace('[LAST_NAME]',$lname,$messagebody);
The result I get is:
[FIRST_NAME]
Doe, This message is to inform you that...
Regardless of which tag I put first or how the syntax is {TAG} $$TAG
or [TAG]
, the first one never gets replaced.
Can anyone tell me why and how to fix this? Thanks