RE: XML. Prevent < from turning into &lt;

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bastien Koert
> On Wed, Sep 9, 2009 at 5:27 AM, Matthew Croud<matt@xxxxxxxxxxxxxxxxxx> wrote:
>>
>> Hiya,
>> I'm writing an app that let's my client upload images, the image html code
>> is added to an XML file.
>> Take a look at the <image> element below:
>>
>> <item Code="e1022">
>>    <code>e1022</code>
>>    <image><![CDATA[<img src="uploads/image2.jpg" alt="Homepage Image"
>> width="124" height="70" />]]></image>
>>    <name>Blue Ski Trousers</name>
>>    <price>8.99</price>
>>  </item>
>>
>> Now, whenever PHP writes this to the XML files, it turns the < and > into
>> &lt; and &gt; . which means it does not display on the webpage.  How can I
>> prevent this from happening ?
>>
> 
> str_replace?
> 

Does the xml string get passed to htmlentities() or a similar function before it is sent to the browser? That would explain the substitutions. I saw an xmlentities() variation mentioned somewhere.

Bob McConnell

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux