-1
Array
(
    [status] => OK
    [result] => Array
        (
            [0] => stdClass Object
                (
                    [id] => 1
                    [name] => normal
                    [points] => 1.00
                    [max_size] => 0
                    [hourly_speed] => 35000
                    [all_pending] => 18009
                    [user_queues] => 0
                )

        )

)

How i can get only values of (status and all_pending and user_queues) from this array ???

MrCode
  • 63,975
  • 10
  • 90
  • 112
Sky
  • 29
  • 5

1 Answers1

0

Don't know what the name of the variable is that holds this array, but let's assume $array.

Status is easy enough, it's just an element of the array. To get all pending and user queues you need to access result, which is an array of objects. [0] references the first element of the array. So $array['result'][0] is the object, then you just need to grab the property you want.

$status = $array['status'];
$all_pending = $array['result'][0]->all_pending;
$user_queues = $array['result'][0]->user_queues;
slapyo
  • 2,979
  • 1
  • 15
  • 24