Xml Reader C# to PHP


Xml Reader C# to PHP

我使用此代码读取 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 上使用相同的值,有可能吗?

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'"]");