Hi there guys and thanks for your continued assistance.
I thought I knew where to place my checks, but it's obvious I don't. I wrote a test script to try to print the names of the problem members(I was going to add to it once I managed that):
include("./includes/armory_init.php");
// $armory->useCache(FALSE);
$members = $guild->getMembers('name', 'asc');
foreach($members as $member) {
//Get character information
$mname = $member['character']['name'];
$mgender = $member['character']['gender'];
$mlevel = $member['character']['level'];
$mrace = $member['character']['race'];
$mclass = $member['character']['class'];
$mrank = $member['rank'];
//Get the member's reputation with the guild.
$character = $armory->getCharacter($mname);
$reputations = $character->getReputation(TRUE,'name','asc');
// print_r($reputations);
if(!is_array($reputations)){
echo "$reputations is not an array!<br /><br />";
}else{
foreach($reputations as $reputation) {
if(!is_array($reputations)){
echo "The array for ".$mname." is corrupt.";
}else{
$rep_name = $reputation['name'];
if($rep_name=="Guild"){
$current_standing = $reputation['standing'];
$current_value = $reputation['value'];
$current_max = $reputation['max'];
$current_remaining = $max-$value;
echo $mname."'s standing with ".$rep_name." is ".$current_standing.".<br /><br />";
}
}
}
}
}
And ran it, expecting to get the normal print statements for the valid members and a notification of which member is failing, but had assumed that since I wasn't trying to do anything with the data of the particular member that I wouldn't get the errors, but here's what it printed for the problem entry:
Aáhz's standing with Guild is 3.
Baaboonbrune's standing with Guild is 3.
Badodis's standing with Guild is 3.
Warning: Invalid argument supplied for foreach() in /home/clash/public_html/includes/wowarmoryapi/Character.class.php on line 491
Warning: Invalid argument supplied for foreach() in /home/clash/public_html/includes/wowarmoryapi/Character.class.php on line 397
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/clash/public_html/includes/wowarmoryapi/Character.class.php on line 517
Warning: Invalid argument supplied for foreach() in /home/clash/public_html/includes/wowarmoryapi/Character.class.php on line 517
Warning: natsort() [function.natsort]: The argument should be an array in /home/clash/public_html/includes/wowarmoryapi/Character.class.php on line 520
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/clash/public_html/includes/wowarmoryapi/Character.class.php on line 524
Warning: Invalid argument supplied for foreach() in /home/clash/public_html/includes/wowarmoryapi/Character.class.php on line 524
This is not an array!
So it told me that it wasn't an array, but only after all the warnings printed to screen.
I'm guessing that I've placed the checks in the wrong spot. How would I set the is_array checks to stop the warnings and begin writing my stuff to print the problem data?