-2
Array
(
    [results] => Array
        (
            [0] => stdClass Object
                (
                    [mode] => 1
                    [score] => 7.4
                    [status] => no
                    [createdAt] => 2013-10-22T11:37:11.411Z
                    [updatedAt] => 2013-10-22T13:43:41.474Z
                    [objectId] => jTY3eWXUbh
                )

        [1] => stdClass Object
            (
                [audio] => stdClass Object
                    (
                        [__type] => File
                        [name] => 9a6c2bf3-6c35-47dc-91ca-9475786cf932-Download free ringtones for your mobile phone _ Zedge.mp3

                    )

                [score] => 7.5
                [status] => no
                [createdAt] => 2013-10-14T14:19:09.240Z
                [updatedAt] => 2013-10-22T13:43:43.347Z
                [objectId] => eRwDodefiO
            )

    )

)

我将如何使用 foreach 打印每个分数?

4

1 回答 1

1
foreach($yourArray["results"] as $object)
{
    echo $object->score;
    echo "<br>";
}
于 2013-10-22T14:35:23.177 回答