Testpagina

Deelnemers Beursvloer Tilburg 2016

[insert_php]

$last_char = ”;

$jsondata = file_get_contents(“http://www.beursvloertilburg.nl/api/ritb/get_publicatie/”);
$json = json_decode($jsondata,true);

sort($json[‘deelnemer’]);

$output = “”;
foreach($json[‘deelnemer’] as $deeln){

$this_char = strtoupper(substr($deeln[‘naam’],0,1));

if ($this_char != $last_char) {
echo “<a href=#”.$this_char.”>”.$this_char.” </a>”;
$output .= “</ul><h4><a name='”.$this_char.”‘>”.$this_char.”</a></h4><ul><li>” .$deeln[“naam”] .”</li>”;
} else {
$output .= “<li>” .$deeln[“naam”] .”</li>”;
}

if ($last_char != ”) {
$last_char = $this_char;
} else {

$last_char = $this_char;
}
}
$output .”</h3></ul>”;
echo $output;

[/insert_php]