在两个标记之间嵌入XML内的特殊标记

时间:2010-12-22 10:14:57

标签: php html xml

我在XML中嵌入HTML标记有很多错误。 像这样:

 <?xml version="1.0" encoding="UTF-8"?>
 <main>     
    <note>
        <category>computers</category>
        <id>1</id> 
            <price>47072.00</price>
        <description>
                <p>Warranty - 24<br />Product model code - N150
                Plus&nbsp;<br />            
            </description>      
   </note> 
</main>

我需要在代码之间插入此代码...以使用PHP读取XML文件

像这样:

<description>
       <![CDATA[<html
        ...HTML CODE IS HERE

        ]]>
</description>

1 个答案:

答案 0 :(得分:1)

使用file_get_contents()将xml文件作为数组打开。

相关问题