我将此代码用于读取C#
上的xml值XmlDocument doc1 = new XmlDocument();
doc1.Load("http://apps.db.ripe.net/whois/search.xml?query-string=" + textBox1.Text + "&source=ripe");
descr_1 = doc1.SelectSingleNode("/whois-resources/objects/object[@type=\"route\"]/attributes/attribute[@name=\"descr\"]");
现在我需要在php上使用相同的值,这是可能的吗?
答案 0 :(得分:0)
php如何处理html表单数据也有点不同所以我没有把textBox1放在这里,但你应该能够轻松找到它。
$sxe = new SimpleXMLElement("http://apps.db.ripe.net/whois/search.xml", NULL, TRUE);
$sxe->xpath("/whois-resources/objects/object[@type=\"route\"]/attributes/attribute[@name=\"descr\"]");