PHP 使用 XML Expat 解释xml文件






	
		qianu
		22
		000000
	
	
		kejian
		23
		999999
	


test php



	";break;
			case "NAME" : echo "name : ";break;
			case "AGE" : echo "age : ";break;
			case "PASSWORD" : echo "password : ";
		}
	}

	//标签内容
	function char($parser, $data) {
		echo $data;
	}
	
	//结束标签
	function stop($parser, $element_name) {
		echo "
"; } //配置 xml_set_element_handler($parser, "start", "stop"); xml_set_character_data_handler($parser, "char"); $fxml = fopen("user.xml", "r"); while($data = fread($fxml, 4096)) { xml_parse($parser, $data, feof($fxml)); } xml_parser_free($parser); ?>

供以后查询。

你可能感兴趣的:(php)