string - How to enclose text within [cdata]...[!cdata] using PHP? -
i'm getting text in variable follows:
$text = 'this code snippet';
now want enclose above text within [cdata]...[!cdata].
the output of echo $text should below:
[cdata]this code snippet[!cdata]
how should this?
thanks.
try
$text = 'this code snippet'; $text = '[cdata]'.$text.'[!cdata]'; echo $text;
Comments
Post a Comment