Jump to content

xpath and curl


dflow

Recommended Posts

how would i query with xpath a specific node with city_id=2

//city_list
<cities>
<city>
<city_name>Barcelona</city_name>
<city_id>2</city_id>
</city>
<cities>


$ch = curl_init("http://example.com/citylist.php?rt=".$rt."");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
$data = curl_exec($ch);
curl_close($ch);
$xmlcitylist = new SimpleXmlElement($data, LIBXML_NOCDATA);

Link to comment
https://forums.phpfreaks.com/topic/240689-xpath-and-curl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.