AtomParser::xml_escape() WordPress Method

The AtomParser::xml_escape() method is a utility function forescaping strings for use in XML documents. It replaces any specialcharacters in the string with their XML entity equivalents. This isuseful for creating XML documents from data that may contain specialcharacters, such as user-generated content.

AtomParser::xml_escape( $content ) #


Source

File: wp-includes/atomlib.php

    function xml_escape($content)
    {
             return str_replace(array('&','"',"'",'<','>'),
                array('&amp;','&quot;','&apos;','&lt;','&gt;'),
                $content );
    }

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.