Hi,
I have a template (HTML) containing markers, for example <%MARKED%>. The PHP script has an array of markers, and an array of replacement content.
The script uses preg_replace($markers, $content, $html) and it's not behaving as expected.
The output contains the content as hoped, but it also contains the first and last character of the marker.
For example..
<%MARKED%> will be replaced with <hello world> and I don't want those first and last characters. It's the same no matter which characters are used.
%...% <...> !...! etc all give the same behaviour.
I hope this made sense, it was tricky to explain :-/
--Glen![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Memoria mihi benigna erit qui eam perscribam
I have a template (HTML) containing markers, for example <%MARKED%>. The PHP script has an array of markers, and an array of replacement content.
The script uses preg_replace($markers, $content, $html) and it's not behaving as expected.
The output contains the content as hoped, but it also contains the first and last character of the marker.
For example..
<%MARKED%> will be replaced with <hello world> and I don't want those first and last characters. It's the same no matter which characters are used.
%...% <...> !...! etc all give the same behaviour.
I hope this made sense, it was tricky to explain :-/
--Glen
Memoria mihi benigna erit qui eam perscribam