[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.133.131.95: ~ $
<?PHP
/**
 * This example shows how to create any object
 * from an XML document. In this case we get
 * some aggregated objects for channel and items
 * from an RSS feed.
 *
 * @author  Stephan Schmidt <schst@php.net>
 */
error_reporting(E_ALL);

require_once 'XML/Unserializer.php';

/**
* class for the RDF docuemnt
*
*
*/
class rdfDocument
{
    var $channel;
    var $item;

    function getItems($amount)
    {
        return array_splice($this->item,0,$amount);
    }
}


/**
* class that is used for a channel in the RSS file
*
* you could implement whatever you like in this class,
* properties will be set from the XML document
*/
class channel
{
    function getTitle()
    {
        return  $this->title;
    }
}

/**
* class that is used for an item in the RSS file
*
* you could implement whatever you like in this class,
* properties will be set from the XML document
*/
class item
{
    function getTitle()
    {
        return  $this->title;
    }
}


$options = array(
                 XML_UNSERIALIZER_OPTION_COMPLEXTYPE => 'object',
                 XML_UNSERIALIZER_OPTION_TAG_MAP     => array(
                                                            'rdf:RDF' => 'rdfDocument',   // this is used to specify a classname for the root tag
                                                        )
                );

//  be careful to always use the ampersand in front of the new operator 
$unserializer = &new XML_Unserializer($options);

$status = $unserializer->unserialize('http://pear.php.net/feeds/latest.rss',true);    

if (PEAR::isError($status)) {
    echo 'Error: ' . $status->getMessage();
} else {
    $rss = $unserializer->getUnserializedData();

    echo 'This has been returned by XML_Unserializer:<br>';
    
    echo '<pre>';
    print_r($rss);
    echo '</pre>';

    echo '<br><br>Root Tagname: '.$unserializer->getRootName().'<br>';
    
    echo 'Title of the channel: '.$rss->channel->getTitle().'<br>';

    $items = $rss->getItems(3);
    echo '<br>Titles of the last three releases:<br>';
    foreach ($items as $item) {
        echo 'Title : '.$item->getTitle().'<br>';
    }
}
?>

Filemanager

Name Type Size Permission Actions
Serializer_Bug7112.php File 724 B 0644
example.xml File 82 B 0644
serializeAndEncode.php File 1.42 KB 0644
serializeAndReturn.php File 609 B 0644
serializeCData.php File 838 B 0644
serializeIndexedArray.php File 2.49 KB 0644
serializeIndexedArrayWithContext.php File 1.01 KB 0644
serializeNullProperties.php File 1.34 KB 0644
serializeObject.php File 1.29 KB 0644
serializeRDF.php File 3.02 KB 0644
serializeSelectiveAttributes.php File 1.6 KB 0644
serializeWithAttributes.php File 1.16 KB 0644
serializeWithAttributes2.php File 1.33 KB 0644
serializeWithComment.php File 974 B 0644
serializeWithDtd.php File 925 B 0644
serializeWithIndentedAttributes.php File 1.43 KB 0644
serializeWithNamespace.php File 1.05 KB 0644
serializeWithTagMap.php File 2.7 KB 0644
unserializeAnyXML.php File 2.55 KB 0644
unserializeClassNames.php File 1.19 KB 0644
unserializeEncoded.php File 949 B 0644
unserializeEnum.php File 1.16 KB 0644
unserializeObject.php File 1.44 KB 0644
unserializeRDF.php File 2.08 KB 0644
unserializeWhitespace.php File 1.09 KB 0644
unserializeWithAttributes.php File 796 B 0644
unserializeWithTagMap.php File 1.62 KB 0644
unserializeWithTypeGuessing.php File 950 B 0644