Login   Register  
PHP Classes
elePHPant
Icontem

File: sample4.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  QXML  >  sample4.php  >  Download  
File: sample4.php
Role: Example script
Content type: text/plain
Description: Sample: Get IP-Info, convert to XML, convert to object and work on it
Class: QXML
XML <> Array (preserve attrib.), JSON, etc.
Author: By
Last change: - changing source for better understanding
Date: 6 years ago
Size: 402 bytes
 

Contents

Class file image Download
<?php

include_once("QXml.class.php");
include_once(
"QWhoIsIP.class.php");

$array = array("213.217.37.242""83.98.158.11""12.0.0.0");

$whois = new QWhoIsIP($array);
$ipinfo $whois->getResult();

$xml = new QXML;
$xml->toXML($ipinfo);

$object $xml->asObject();

print 
$object->ip->addresses[0]->descr[0];
print 
"<hr/>";
print 
"<pre>";
print_r($object);
print 
"</pre>";

?>