Beginner question: first time PHP api use

I have never used PHP before, only CFML for web applications.
Now I am trying to use responses from an API in a web application in PHP.
The use of the API is working but I have absolutely no idea how to format this answer so that I can use it in my web application.

I receive this response in my code:

Array
(
[query] => xyz.be
[suggests] => Array
(
[xyz] => Array
(
[tv] => 1
)

        [comoxyz] => Array
            (
                [net] => 1
            )

        [xyzblanco] => Array
            (
                [net] => 1
            )

        [chpa] => Array
            (
                [tv] => 1
            )

        [pedroxyz] => Array
            (
                [net] => 1
            )

        [xyzverde] => Array
            (
                [net] => 1
            )

        [xyzonline] => Array
            (
                [com] => 1
            )

        [unxyz] => Array
            (
                [com] => 1
            )

        [suspiroyz] => Array
            (
                [com] => 1
            )

        [xyzlibre] => Array
            (
                [com] => 1
            )

        [bikexyz] => Array
            (
                [com] => 1
            )

        [yxyz] => Array
            (
                [com] => 1
            )

        [xyzrojo] => Array
            (
                [net] => 1
            )

        [xyzweb] => Array
            (
                [com] => 1
            )

        [cabezoyz] => Array
            (
                [com] => 1
            )

        [miguelxyz] => Array
            (
                [com] => 1
            )

        [xyzagua] => Array
            (
                [com] => 1
            )

    )

)

How can I use this data to be displayed like this:

xyz.tv

comoxyz.net

xyzblanco.net

chpa.tv

roll over the $array['suggest'] with foreach so you have the key, then take the first key from array_keys() of the value.

Sponsor our Newsletter | Privacy Policy | Terms of Service