PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Matthew Johnston   Call of Duty World at War Stat Fetcher   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Call of Duty World at War Stat Fetcher
Extract statistics from Call of Duty files
Author: By
Last change: Added error checking example
Date: 15 years ago
Size: 902 bytes
 

Contents

Class file image Download
<?php
include 'class.CoDStats.php';
$console = "xbox"; //a console, either ps3 or xbox
$player_id = "2533274791915247"; //the users id you can find out how to find this at cod5.classicwars.com

$stats = new CoDStats($console, $player_id);

echo
$stats->__get("xp"); //using the __get() function to fetch the xp data reffer to the class to find a list of data you can fetch
echo $stats->__get("kills"); //fetches total ammount of kills a player has had

echo $stats->_list_accepted_attributes(); //displays a list of all the accepted attributes for the __get() functions

$data = $stats->_get_data_array(); //puts all the data into an array of $data[]

echo "<pre>";
print_r($data); //showing the structure of the $data array
echo "</pre>";

if(
$stats->errors === true){
    die(
"Errors found unable to parse XML"); //manual error check
}else{
    echo
"Parsed all XML!";
}

?>