Hallo, ik ben bezig met een api aan het maken voor runescape voor me eigen website.

Nu stuit ik op een probleem hij laat keurig alle arrays zien zoals het hoord.
Alleen nu wil ik dus eigenlijk alle arrays in 3 rijen hebben onder elkaar.
Met een plaatje voor elke array.
Kan iemand mij hier mee verder helpen ?
In onderstaant plaatje heb ik het een klein beetje duidelijker gemaakt.



Zo izet het er nu uit



Bedankt



<?php
$user = urldecode($_GET['user']);
if(isset($_GET['callback'])) $callback = $_GET['callback'];

function getStats($name) {
		$hiscores = array("Overall",
				"stats" => array(        
						"Attack", "Defence", "Strength",
						"Hitpoints", "Ranged", "Prayer",
						"Magic", "Cooking", "Woodcutting",
						"Fletching", "Fishing", "Firemaking",
						"Crafting", "Smithing", "Mining",
						"Herblore", "Agility", "Thieving",
						"Slayer", "Farming", "Runecrafting",
						"Hunter", "Construction", "Summoning",
						"Dungeoneering"
						),
				"minigames" => array(
						"Duel Tournaments", "Bounty Hunters",
						"Bounty Hunter Rogues", "Fist of Guthix",
						"Mobilising Armies", "B.A Attackers",
						"B.A Defenders", "B.A Healers",
						"Castle Wars Games", "Conquest"
				)
		);
		$name = strtolower($name);
		$connection = fopen('http://services.runescape.com/m=hiscore_oldschool/index_lite.ws?player='.$name, 'rb');
		$data = stream_get_contents($connection);
		fclose($connection);
		$data = explode("\n", $data);
		$overall = explode(',', $data[0]);
		$stats['overall'] = array("Rank" => $overall[0], "Level" => $overall[1], "XP" => $overall[2]);
		for($i = 0; $i < 25; $i++) {
			$cItem = $hiscores['stats'][$i];
			$num = explode(',', $data[$i+1]);
			$stats['skills'][$cItem] = array("Rank" => $num[0], "Level" => $num[1], "XP" => $num[2]);
		}
		for($i = 0; $i < 9; $i++){
			$cItem = $hiscores['minigames'][$i];
			$num = explode(',', $data[$i+27]);
			$stats['minigames'][$cItem] = array("Rank" => $num[0], "Score" => $num[1]);
		}
		
		$stats = json_encode($stats);
		$stats = str_replace('-1', '', $stats);
		if($_GET['lowercase'] === 'yes'){
			$stats = strtolower($stats);
		}
		return $stats;
}

if(isset($_GET['user'])) {
	$cStats = getStats($user);
	if(isset($callback)) {
		echo $callback.'('.$cStats.')';
	}
	else
	{
		echo $cStats;
	}
}
else
{
	echo 'Usage:<br><ul>';
	echo '<li>user=username</li>';
	echo '<li>Optional: callback=funcName</li>';
	echo '<li>Optional: lowercase=yes (all json will be lower case)</li></ul><br>';
	echo 'Callback function is used for cross-domain AJAX requests';
}
?>

Reageren