phpÏÂÄÄÖÖ·½·¨ºÏÊʽâÎöxml£¬×ª»»³Éjson¸ñʽ
½âÎöxmlÎĵµµÄÀà¿âÓкܶàÖÖ£¬±È½Ï³£ÓõľÍÊÇSimpleXML£¬DOM Document£¬XMLReader£¬»ùÓÚSAXµÄxml_parseº¯Êý¡£
¸ù¾ÝxmlÎĵµ½á¹¹£¬ÒÔ¼°ÐèÇóµÄ²»Í¬£¬ÒªÑ¡ÔñºÃ¶ÔÓ¦µÄÀà¿â¡£
½âÎöСµÄÎĵµµÄ»°£¬Ê¹ÓÃSimpleXML±È½ÏºÏÊÊ£¬¼òµ¥µÄ¼¸¸öº¯Êý¾Í¿ÉÒԸ㶨¡£
Èç¹ûÎĵµ·Ç³£¾Þ´ó£¬×îºÃÊÇXMLReader´ò¿ª£¬Öмäת»»³ÉDOMÀ´½âÎö£¬¸Ð¾õDOMÓëXPath½áºÏµÄ±È½ÏºÃ¡£
ÒÔÉÏÊǽâÎöÒÑÖªÎĵµ½á¹¹µÄXML£¬±ÈÈçÖªµÀʹÓÃÁËʲôÃüÃû¿Õ¼ä£¬ÓÐÄÄЩÖ÷ÒªµÄ½ÚµãµÈµÈÐÅÏ¢µÄXMLÎĵµ¡£
Èç¹ûÊÇÒª½âÎöÈÎÒâµÄXMLÎĵµ£¬»¹ÊÇSAXµÄxml_parse±È½ÏºÏÊÊ£¬×Ô¼º¶¨ÒåÈý¸öhandlerº¯Êý¡£
±ÈÈç±ÊÕß¾ÍÊÇÓÃxml_parseÀ´½âÎöÈÎÒâµÄxmlÎĵµ£¬Éú³Éjson¸ñʽµÄ×Ö·û´®¡£
ÏÂÃæ°ÑʹÓÃxml_parseÀ´½âÎöxmlÎĵµµÄËùÐèÒªµÄÈý¸öhandler½²½âÒ»±é¡£
Ê×ÏÈÊÇÈý¸ö±äÁ¿
$depthÊÇÖ¸xmlÎĵµ½á¹¹µÄ²ãÊý£¬µÚÒ»²ãµÄÖµÊÇ0¡£
$json_arrayÊÇÒ»¸ö¶àλÊý×飬ÿһ¸öÔªËصijÉÔ±ÊÇÒ»¸öjsonÊý×飬ֱ½Ó¿ÉÒÔÓÃjson_encodeº¯Êý¡£
Õâ¸öÊý×éµÄµÚһάµÄindexÊÇÉÏÃæµÄ$depth£¬½âÎöÍêÿһ²ãµÄxml½á¹¹ºó£¬¶¼½«Æä½á¹û"Õ³Ìù"µ½Æ丸½ÚµãµÄ×îºóÒ»¸ö×Ö½Úµãºó±ß¡£
½âÎöÍê³Éºó$json_array[0]¾ÍÊÇËùÓеÄxmlÎĵµÄÚÈݶ¼ÔÚÀïÃæÀ²¡£
$tag_name_stackÒ²ÊÇÒ»¸öÊý×飬ºó½øÏȳöµÄÊý×飬ÕýÔÚ´¦ÀíµÄ±êÇ©Ãû¾Í´æÔÚÕâÀïÃ棬´¦ÀíÍêÒ»¸ö±êÇ©ºó£¬¾Í½«ÆäÇë³öÊý×é¡£
private $depth = -1;
private $json_array = array();
private $tag_name_stack = array();
private function start_handler($parser, $name, $attrs) {
$arrts_array = array();
foreach ($attrs as $attr_name => $attr_value) {
$attr_name = str_replace(":", "$", $attr_name);
$arrts_array[$attr_name]=$attr_value;
}
$tag_name = str_replace(":", "$", $name);
$this->tag_name_stack[] = $tag_name;
$this->depth++;
//if (count($arrts_array) != 0) {
$this->json_array[$this->depth][$tag_name] = $arrts_array;<br>
Ê×ÏÈÊǰѸñêÇ©µÄÊôÐÔ¶¼×°ÈëÒ»¸öÊý×é
foreach ($attrs as $attr_name => $attr_value) {
$attr_name = str_replace(":", "$", $attr_nam
Ïà¹ØÎĵµ£º
XMLÔÚÎÒÃǵijÌÐòÖÐÓõ½µÄÔ½À´Ô½¶à£¬ÒòΪËü´æ´¢¡¢¶ÁÈ¡¡¢Ð޸Ķ¼±È½Ï·½±ã¡£
ÏÂÃæÎÒÀ´·ÖÏíÒ»ÏÂXMLµÄ³£ÓòÙ×÷(Ôöɾ¸Ä²é)£¬ÏÂÃæÊdzÌÐòÔËÐÐЧ¹û£º
Ôö(Ôö¼Ó½Úµã°üÀ¨´´½¨XML):
/// <summary>
/// ´´½¨XMLÎĵµ
/// </summary>
/// <param name="path"></param>
......
ÉϺ£ÔóÎäÍøÂçÓÐÏÞ¹«Ë¾
ÕÐƸ£ºÕÐƸjsp\phpÍøÕ¾¿ª·¢³ÌÐòÔ±
ÒªÇóÓÐÈýÄêÒÔÉÏ¿ª·¢¾Ñé
¶ÔTomcat+Apache¼¯Èº¼¼ÊõÓÐÊìϤµÄ¾Ñé.¶ÔËÑË÷ÒýÇæ¼¼Êõ(Lucene)±È½ÏÁ˽⡣
-ÊìÁ·Ê¹ÓÃUML½¨Ä£¹¤¾ß¡¢°æ±¾¿ØÖƹ¤¾ß; ÊìÁ·Ê¹ÓÃEclipseµÈIDE¿ª·¢¹¤¾ß;
-¾«Í¨JAVA,php,ÉîÈëÀí½âOOP˼Ïë,ÊìϤÉè¼Æģʽ¡£
-ÊìÁ·ÔËÓÃJ2EE¼¼Êõ¡¢WEB·þÎñÆ÷ºÍ¹ØϵР......
ת×Ô£ºhttp://nedvedheqing.javaeye.com/blog/383506
1. PHPÀ©Õ¹
JpGraph£ºhttp://www.aditus.nu/jpgraph/
ChartDirector£ºhttp://www.advsofteng.com/
2. JavaScript
Flot (http://code.google.com/p/flot/
) - Flot Ϊ jQuery ÌṩµÄjavascript´úÂë¿â. ÈÝÒ×ʹÓã¬ÓÐÌØÉ«µÄͼ±í£¬Ìṩ½»»¥¹¦ÄÜ(Äܹ»·Å´óËõСÊý¾ÝÇøÓòµ ......
ÈçºÎÓÃphpɾ³ýÎļþÄØ£¿
phpÖÐÓиöº¯Êý½Ð×÷unlink¡£Ö»ÒªÒ»¸ö²ÎÊý£¬±íʾÎļþ·¾¶¾ÍÐÐÁË¡£
bool unlink ( string filename)
³É¹¦É¾³ý·µ»ØÕ棬·ñÔò·µ»Ø¼Ù¡£
Õâ´ÎÎÒÔÚÏîÄ¿ÖУ¬ÐèÒªÓõ½É¾³ýÎļþ²Ù×÷¡£ÎªÁËÍêÃÀµÄ²Ù×÷£¬Ê×ÏÈÒªÅжÏÒ»ÏÂÕâ¸ö·¾¶µÄÎļþÊÇ·ñ´æÔÚ£¬ÓÃfile_existsº¯Êý¡£ÈçÈô´æÔÚ£¬Ôòȥɾ³ýÎļþ¡£¾ßÌå´úÂëÈçÏ£º
i ......
PHP³ÌÐòºÍMySqlÊý¾ÝÂÒÂëÎÊÌâÔÒò¼°½â¾ö
ÂÒÂëÎÊÌâ¼òµ¥Ëµ¾ÍÊÇÊý¾Ý¿âдÈë¶ÁÈ¡£¬ÍøÒ³Îļþ£¬ÍøÒ³ÏÔʾʱ¼¸¸ö»·½ÚµÄ±àÂë²»Ò»ÖÂÔì³ÉµÄ¡£
ÂÒÂëÎÊÌâ
дÈëʱ£ºÒ³ÃæÌáȡдÈëÊý¾Ý±àÂëºÍдÈëÊý¾Ý¿âʱ±àÂë²»Ò»ÖÂ
¶Áȡʱ£º¶ÁÈ¡ºóËùÓñàÂëÓëÊý¾Ý¿âдÈëʱ²»Ò»ÖÂ
ÏÔʾʱ£º±àÂëÓëÊý¾Ý¿â¶ÁÈ¡ºóµÄÊý¾Ý²»Ò»ÖÂ
ºÜÏÔȻֻÓÐÈýÕ߶¼Í³Ò»²ÅÐУ ......