ÍÂѪÁË,Ìá¸öPHPдXMLµÄÎÊÌâ - PHP / ¿ªÔ´×ÊÔ´
´úÂë:
<?php
$im=$_POST['upPicName'];
$it=$_POST['upPicTitle'];
$pa=$_POST['upPicAlbum'];
$pt=$_POST['upPicThumb'];
//echo $im.$it.$pa.$pt;
$doc = new DOMDocument();
$doc ->formatOutput = true;
$doc->load('pic.xml');
$project=$doc->documentElement->getElementsByTagName('medias');
//$root = $doc->createElement('media');
//$doc->appendChild($root);
/**Ìí¼ÓͼƬµÄÃû×Ö
$root_im = $doc->createAttribute('imgname');
$root->appendChild($root_im);
$root_im_text=$doc->createTextNode($im);
$root_im->appendChild($root_im_text);
//½áÊø
//Ìí¼Ó±êÌâ
$root_it = $doc -> createAttribute('title');
$root->appendChild($root_it);
$root_it_text=$doc->createTextNode($it);
$root_it->appendChild($root_it_text);
//½áÊø
//Ìí¼Óר¼Ãû³Æ
$root_pa=$doc->createAttribute('section');
$root->appendChild($root_pa);
$root_pa_text=$doc->createTextNode($pa);
$root_pa->appendChild($root_pa_text);
//½áÊø
//ÊÇ·ñΪ±êÌâ
$root_pt=$doc->createAttribute('thumb');
$root->appendChild($root_pt);
$root_pt_text=$doc->createTextNode($pt[0]);
$root_pt->appendChild($root_pt_text);
**///½áÊø
$doc->saveXML('pic.xml');
?>
XML:
<?xml version="1.0" encoding="utf
Ïà¹ØÎÊ´ð£º
DataSetµ¼³öxml Åú´¦Àí(Ñ»·)µÃÔõô´¦Àí
XMLÎļþ
<A>
<B>
<C>
</C>
&nb ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Çý¶¯³ÌÐò¹ÜÀíÆ÷] δ·¢ÏÖÊý¾ÝÔ´Ãû³Æ²¢ÇÒδָ¶¨Ä¬ÈÏÇý¶¯³ÌÐò, SQL state IM002 in SQLConnect in D:\0\msc\msc\tel.php on line 44
Í ......
PHPÖÐ ÉùÃ÷±äÁ¿µÄʱºòÒ»¸ö$¸úÁ½¸ö$µÄÇø±ð
±ÈÈç˵
$var="333"; ±íʾ±äÁ¿ÃûΪ$varµÄ±äÁ¿µÄֵΪ333
$var="myvar";$$var="333";±íʾ±äÁ¿ÃûΪ$myvarµÄ±äÁ¿µÄֵΪ333
ÕâÑù˵Çå³þÁËÂð£¿
......