Èç¹ûÍùÒÑÓеÄxmlÎļþÖÐÌí¼Ó¼Ç¼£¿ - PHP / »ù´¡±à³Ì
±ÈÈçÓиöa.xmlÎļþ£¬ÄÚÈÝÈçÏ£º
XML code:
<?xml version="1.0" encoding="gb2312" ?>
<document>
<item>
<name>ÕÅÈý</name>
</item>
</document>
ÇëÎÊÈçºÎÔÚºóÃæÌí¼ÓÒ»ÌõÕâÑùµÄ¼ÇÂ¼ÄØ£¿
<item>
<name>ÀîËÄ</name>
</item>
¶¼Ð´µ½documentÀï
ÎÒÖªµÀдÔÚdocumentÀ¾ßÌåÈçºÎд½øÈ¥ÄØ£¿ÎÒÒ»¸ã¾Í°ÑÇ°Ãæ¼Ç¼ŪûÁË¡£
End_rbody_64879351//-->
¸Ã»Ø¸´ÓÚ2010-04-22 11:17:55±»¹ÜÀíԱɾ³ý
¶ÔÎÒÓÐÓÃ[0]
¶ª¸ö°åש[0]
ÒýÓÃ
¾Ù±¨
¹ÜÀí
TOP
jakey9826
(×ÔÓÉ»ð)
µÈ¡¡¼¶£º
9
4
2
#4Â¥ µÃ·Ö£º19»Ø¸´ÓÚ£º2010-04-22 11:19:52
PHP code:
$doc = new DOMDocument;
$doc->load('t1.xml');
$node = $doc->createElement("item");
$dups = $doc->documentElement->getElementsByTagName('item');
$newnode = $dups->item(0)->parentNode->appendChild($node);
$namenode = $doc->createElement("name");
$namenode->appendChild($doc->createTextNode(iconv("gbk", "utf-8", "ÀîËÄ")));
Ïà¹ØÎÊ´ð£º
<?xml version="1.0"?>
<root>
<status>433</status>
<msg>Õâ¸öÊǺº×Ö</msg>
<serialno>123</serialno>
</root>
ÈçºÎÓÃASP¶ÁÈ¡ statusÖµ ......
zend guard¼ÓÃܵÄphpÊÇ¿ÉÒÔÆÆ½âµÄ£¬ÓÐµÄ ËµÊÇʹÓú¯Êý»ìÏý¿ÉÒÔ¸üÄÑÆÆ½âһЩ¡£ÔõôʹÓÃÄØ¡£
»òÕß´ó¼Ò¸æËßÎÒÄÄÖÖ¼ÓÃÜ·½Ê½¸ü°²È«¡£Ð»Ð»ÁË¡£
ÎÒĿǰµÄzend guard°æ±¾ÊÇ4.0.1
ÎÞ½â
ÒýÓÃ
ÎÞ½â
²»¿ÉÄܰɡ£ÔÚÍøÉϲéÁ ......
ÎÒÓÐÒ»¸öÀàËÆµÄxmlµÄ string£¬Ïëͨ¹ý±éÀúÔõô¸öxml Êä³öÎÒÏëÒªµÄelementµÄÖµ
xml Ϊ£º
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_XML_ME ......
ÏÖÔÚÓиöxmlÎļþÊÇ<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
ÈçÌ⣬Ôõôд¸öheadÍ·²¿ ÈÃÒ³Ãæ»º´æ1ÐÇÆÚ¡£
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Äã°ÑÀïÃæµÄʱ¼ä£¬¸Ä³Éµ±Ç°Ê±¼ä¼ÓÉÏÒ»¸öÐÇÆÚ
¼ÇµÃҪת»»³Égmtʱ¼ä
ÎÒÕâÑùдµÄ ²»ÖªµÀÐв»ÐС£
Ò»¸öÐ ......