|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12447 Function to encode strings for XML
Submitted: 2001-07-28 06:38 UTC Modified: 2002-11-30 09:20 UTC
From: Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2001-07-28 06:38 UTC]
Currently I use

function &xml_encode(&$xml) {
  $xml = str_replace(array('?', '?', '?',
                           '?', '?', '?',
                     array('ü', 'Ü', 'ö',
                           'Ö', 'ä', 'Ä',

  $xml = preg_replace(array("/\&([a-z\d\#]+)\;/i",

  return $xml;

to 'encode' strings for use with XML. A 'PHP Land' implementation of this would be handy, I think.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-30 09:20 UTC]
ext/recode has an XML mode. Maybe that helps (not sure about windows, though)

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 18 08:03:18 2022 UTC