Skip to content

Instantly share code, notes, and snippets.

@ken-muturi
Last active August 3, 2016 08:35
Show Gist options
  • Save ken-muturi/b9def659c229ac27f2f4d6df6a3d32c9 to your computer and use it in GitHub Desktop.
Save ken-muturi/b9def659c229ac27f2f4d6df6a3d32c9 to your computer and use it in GitHub Desktop.
mark-xml
public function xml()
{
$url = '';
$this->load->helper('curl');
$response = curl::get("{$url}:8080/services/user/devices.xml");
$devices = new SimpleXMLElement($response);
util::printr( $devices );
foreach ($devices->id as $device)
{
$device = rawurlencode($device);
util::printr("{$url}:8080/services/user/varInfo.xml?id={$device}" );
$variables_response = curl::get("{$url}:8080/services/user/varInfo.xml?id={$device}");
$variables = new SimpleXMLElement($variables_response);
util::printr( $variables );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment