0

I have a CMS which builds content to a static page. You just place some made up "tags" in the HTML source and the CMS converts them with the database value.

$faqContent = "<cms:html_body>";
$faqContent = '<cms:html_body>';

The problem is, some of the fields have apostrophes (for grammar), some of the fields have double quotes (as some include hyper links).

So if I wrap $faqContent in single or double quotes, it will break at least once depending on what field it is outputting.

I'm confused now.. what shall I do? I don't want to convert to ASCII codes as the hyperlinks will output as text, not HTML.

4

1 回答 1

1

对于简单的代码,您必须使用常规的 PHP 字符串。

但是,您必须避免将大量结构化文本定义为 PHP 字符串
而是从文件中加载它们或使用某种模板系统

于 2013-09-03T14:26:24.650 回答