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

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -