Jump to content
AurelioBR

js API esporte - Como faço para capturar e dar print no browser

Recommended Posts

Olá a todos , por favor estou com problemas para dar um print em somente alguns itens em um Array em uma API  json gostaria de uma ajuda.

 

ESTE É O RESULTADO .

 

TIMEA:

SCORE:

TIMEB:

stdClass Object
(
    [success] => 1
    [data] => stdClass Object
        (
            [match] => Array
                (
                    [0] => stdClass Object
                        (
                            [away_name] => Barito Putera
                            [last_changed] => 2019-07-05 10:25:02
                            [added] => 2019-07-05 08:15:03
                            [status] => FINISHED
                            [league_name] => GO-JEK Liga 1
                            [ht_score] => 2 - 2
                            [time] => FT
                            [away_id] => 2322
                            [events] => https://livescore-api.com/api-client/scores/events.json?key=pRhjavXSt4U4jDzl&secret=YQVnzZo4BVWzuLiTCzcN59FyezCydcTc&id=148162
                            [ft_score] => 3 - 3
                            [home_name] => Perseru Serui
                            [league_id] => 353
                            [id] => 148162
                            [et_score] => 
                            [score] => 3 - 3
                            [home_id] => 195
                        )

<?php
$url = "https://livescore-api.com/api-client/scores/live.json?key=xxxxxxxxxxxxxx&secret=xxxxxxxxxxxxxxx";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$jogosdehoje = json_decode(curl_exec($ch));
print_r($jogosdehoje);
?>

 

 

ESTE É O CODIGO QUE ESTOU USANTO PARA DAR PRINT NO BROWSER :

 

        <h4><?php echo "TIMEA:".$result['match'];?></h4>
        <h4><?php echo "SCORE:".$result['status'];?></h4>
        <h4><?php echo "TIMEB:".$result['score'];?></h4>

 

Obrigado a quem puder me ajudar .

 

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.