PHP¶ÁÈ¡XMLÎÊÌâ
PHP code:
$doc=new DOMDocument("1.0","utf-8"); #ÉùÃ÷ÎĵµÀàÐÍ
$doc->formatOutput=true; #ÉèÖÿÉÒÔÊä³ö²Ù×÷
#ÉùÃ÷¸ù½Úµã£¬×îºÃÒ»¸öXMLÎļþÓиö¸ú½Úµã
$root=$doc->createElement("root"); #´´½¨½Úµã¶ÔÏóʵÌå
$root=$doc->appendChild($root); #°Ñ½ÚµãÌí¼Ó½øÀ´
# for($i=1;$i<100;$i++){ //Ñ»·Éú³É½Úµã£¬Èç¹ûÊý¾Ý¿âµ÷ÓóöÀ´¾Í¸ÄÕâÀï
$info=$doc->createElement("info"); #´´½¨½Úµã¶ÔÏóʵÌå
$info=$root->appendChild($info); #°Ñ½ÚµãÌí¼Óµ½root½ÚµãµÄ×Ó½Úµã
$name_value=$doc->createAttribute("value"); #´´½¨½ÚµãÊôÐÔ¶ÔÏóʵÌå
$name_value=$info->appendChild($name_value); #°ÑÊôÐÔÌí¼Óµ½½ÚµãinfoÖÐ
$name=$doc->createElement("name"); #´´½¨½Úµã¶ÔÏóʵÌå
$name=$info->appendChild($name);
$sex=$doc->createElement("sex");
$sex=$info->appendChild($sex);
$name->appendChild($doc->createTextNode("MUSIC")); #createTextNode´´½¨ÄÚÈݵÄ×ӽڵ㣬Ȼºó°ÑÄÚÈÝÌí¼Óµ½½ÚµãÖÐÀ´
$name_value->appendChild($doc->createTextNode("ÕÅÈý"));
$sex->appendChild($doc->createTextNode("ÄÐ")); #×¢ÒâҪתÂë¶ÔÓÚÖÐÎÄ£¬ÒòΪXMLĬÈÏΪUTF-8¸ñʽ # }
$name->appendChil
Ïà¹ØÎÊ´ð£º
ÇëÎÊÏÂÄܲ»ÄÜÔÙwindows϶¨ÆÚÇå¿ÕmysqlÒ»¸ö±íÖеÄÈ«²¿Êý¾Ý£¬ÓÃPHPʵÏÖ£¡
лл¸÷λÁË
¾Í±ÈÈçÒ»¸öÐÇÆÚÇå¿ÕÒ»´Î
±ÈÈçÿ¸öÐÇÆÚÁùÁãµãÇå¿ÕÒ»´Î£¡
ллÁË
¼Æ»®ÈÎÎñ...php....sql...truncate....OK
Äã¾ÍÕâ½ÓÔÚҳà ......
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
<?xml version="1.0"?>
<root>
<status>433</status>
<msg>Õâ¸öÊǺº×Ö</msg>
<serialno>123</serialno>
</root>
ÈçºÎÓÃASP¶ÁÈ¡ statusÖµ ......
index.phpÄÚÈÝ£º
$smarty->assign('name',strtotime('-0'));
$smarty->display("index.html");
index.htmlÄÚÈÝ£º
{$name|date_format:'%Y-%m-%d'}<hr>
{$ ......
ĿǰÔÚÎ人ÕÒ¹¤×÷
·¢Ïִ󲿷ֹ«Ë¾ÎÞÍâºõÁ½ÖÖ
Ò»ÖÖÊǸãÍâ°üµÄ ÒªÓÃzend,cakephpµÈÍâ¹ú¿ò¼Ü
»¹ÒªÊìϤÍâ¹ú¿ªÔ´ÏµÍ³
Ò»ÖÖ¹úÄÚµÄ ÎÞÍâºõ dedecms ecshop shopexÕ⼸ÖÖ¸ÄÕ¾µã ÓеĹ«Ë¾ÉõÖÁÄÃһЩ¸üСµÄϵͳ¸ ......