随笔分类 - XML
摘要://天气预报$weather_xml = file_get_contents('http://www.google.com/ig/api?weather=guangzhou');$xml = simplexml_load_string($weather_xml);$xml->forecast_information->city->attributes; //读一个节点的属性$wea['city'] = $xml->weather->forecast_information->postal_code->attributes
阅读全文
摘要:本类实现: 数据库信息导出:word,excel,json,xml,sql 数据库恢复:从sql,从文件 具体用法:首先新建测试用数据库mytest,然后在里面建张表 PHP代码:以下是代码片段: -- --表的结构`test` -- CREATETABLE`test`( `id`int(11)NOTNULLauto_increment, `name`varchar(100)NOTNULL, `email`varchar(200)NOTNULL, `age`int(3)NOTNULL, PRIMARYKEY(`id`) )ENGINE=MyISAMDEFAULTCHARSET=utf8AU..
阅读全文
摘要:<?php//创建XML方法 $doc = new DOMDocument('1.0', 'utf-8'); // 声明版本和编码 $doc->formatOutput = true; //格式化输出内容 $php = $doc->createElement('php'); //创建XML元素$phplib = $doc->createElement('phplib');$mysql = $doc->createElement('mysql');$lib_id = $doc->c
阅读全文
摘要:get_xml.php文件<?php//获取XML 方法header('Content-type:text/html; charset=utf-8'); $doc = new DOMDocument(); //实例化DOM组件$doc->load('get_xml.xml'); //载入XML文件$book = $doc->getElementsByTagName('book'); //获取文件标签名$title = $doc->getElementsByTagName('title'); foreach
阅读全文

浙公网安备 33010602011771号