Visualizing data from JSON

Simple visualization of data from input JSON

Example 1 | Settings array

1. Disable images

2. Bronze match available but we dont want to show it

3. Bronze match available in list but we need array correction true

                
                $file = 'https://raw.githubusercontent.com/openfootball/world-cup.json/master/2018/worldcup.json';

                $json = file_get_contents($file);
                $obj = json_decode($json);
                $teams_d = array();
                $teams_h = array();
                $teams_a = array();
                
                foreach($obj->rounds as $matchdays){
                    foreach($matchdays->matches as $match){
                        if(isset($match->knockout)){
                            if($match->knockout == true){
                                $teams_h["name"] = $match->team1->name;
                                $teams_h["score"] = $match->score1;
                                $teams_h["et_score"] = $match->score1et;
                                $teams_h["pt_score"] = $match->score1p;
                
                                $teams_a["name"] = $match->team2->name;
                                $teams_a["score"] = $match->score2;
                                $teams_a["et_score"] = $match->score2et;
                                $teams_a["pt_score"] = $match->score2p;
                
                                $teams_d[] = $teams_h;
                                $teams_d[] = $teams_a;
                            }
                        }
                    }
                }

                $settings = array('image'=>false, 'bronze'=>false, 'nobronze' =>true);
                $brackets = new Visualizer($teams_d, $settings);
                echo $brackets->RenderFromData();   
                
                
Round of 16
Quarter-Finals
Semi-Finals
Final
Uruguay
2
Portugal
1
France
4
Argentina
3
Spain
1
Russia
1
Croatia
1
Denmark
1
Brazil
2
Mexico
0
Belgium
3
Japan
2
Sweden
1
Switzerland
0
Colombia
1
England
1
Uruguay
0
France
2
Brazil
1
Belgium
2
Russia
1
Croatia
1
Sweden
0
England
2
France
1
Belgium
0
Croatia
1
England
1
France
4
Croatia
2