Hi all,

a quick question does anyone know how I might modify my code, for the switch cases to appear sequential on my web banner?

it currently uses a random choice but would love to order the output, my code is below:

thanks!

<?php
$num = rand (1,5);
class XmlToJson {

public function Parse ($url) {

$fileContents= file_get_contents($url);

$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);

$fileContents = trim(str_replace('"', "'", $fileContents));

$simpleXml = simplexml_load_string($fileContents);

$json = json_encode($simpleXml);

return $json;

}

}

switch ($num)
{
case 1:

$jsone = XmlToJson::Parse("http://www.microgaming.co.uk/pokerfeeds/WebServiceViewOnline.asmx/ViewOnlineXML");

$jsond = json_decode($jsone, true);

$totalPlayers = $jsond['GLOBAL']['@attributes']['totalPlayers'];

$filledSeats = $jsond['GLOBAL']['@attributes']['filledSeats'];

echo json_encode('<h2>Total Player Count</h2> ' . $totalPlayers . ' Players Online');

break;

case 2:

ob_start();
include 'bbjackpot.php';
$view = ob_get_clean();
echo json_encode(''. $view);

break;

case 3:
echo json_encode('<h2>The first online poker network</h2> to offer real play poker on Android mobile devices.');

break;
case 4:
echo json_encode('<h2>The first online poker network</h2> to offer a fast-fold poker variant, Blaze.');

break;
case 5:
echo json_encode('<h2>The first online poker network</h2> management board, created in 2011.');

break;
}
?>