Advertisement
Guest User

SimpleXMLElement support utf8

a guest
Jul 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. $utf8 = utf8_encode('2\x0F -8- 15');
  2. $xml_user_info = new SimpleXMLElement("<?xml version=\"1.0\"?><user_info><a>2 -8- 15</a> <b>$utf8</b></user_info>");
  3.  
  4. $xml_file = $xml_user_info->asXML();
  5.  
  6. echo $xml_file;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement