I am working with a CMS (content management system) which allows me to use php scripts in its templates. The CMS output content from these templates using its own smart tags, e.g.:
<T4 name="Text" output="normal" modifiers="imagebank, nav_sections"/>
The content produced from these smart tags (which is retrieved from a db which I have no access to) can then be manipulated using php, e.g.
<?php
echo (“ This is my text from the CMS: <T4 name=\"Text\" output=\"normal\" modifiers=\"imagebank, nav_sections\"/>”);
?>
This will be passed to the php engine like this as the CMS does its translation first:
<?php
echo (“ This is my text from the CMS: MY CONTENT ”);
?>
where MY CONTENT is text stored by the CMS.
The problem being how can I avoid problems when the MY CONTENT bit contains quotes? Is there any function that handle this? For example, if MY CONTENT is :
John said “Hello World” to everyone.
The php would like like this:
<?php
echo (“ This is my text from the CMS: John said “Hello World” to everyone. ”);
?>
Obviously causing an error. Is there any function that can handle these rogue double quotes?
Any ideas, anyone? Many, many thanks in advance to whoever can save the day!