Read XML

xiaoxiao2021-03-06  46

Read XML

//Header ("Content-Type: Text / XML); $ XML =" / N "; $ XML = $ XML." "; $ XML = $ xml. " noname / n"; $ XML = $ XML. " 666666 / n"; $ XML = $ XML. "";

$ Parser = xml_parser_create (); // build an XML parser xml_parser_set_option ($ parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option ($ parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct ($ parser, $ xml, $ values, $ tags); / / Resolution XML data into an array XML_Parser_Free ($ PARSER); // Print $ VALUES to see, the landlord you know this array and your XML data Contact Foreach ($ VALUES AS $ VAL) {// I have seen the array above, I know that IF is IF ($ VAL ['Tag'] == 'UserName') $ Name = $ VAL ['Value']; if ($ VAL ['tag'] == 'password') $ PWD = $ VAL ['Value'];} echo "
username:". $ name. "
"; // Show Result Echo "Password:". $ PWD;

转载请注明原文地址:https://www.9cbs.com/read-74291.html

New Post(0)