Reputation:
Is there a way to get the values of a JSON object member variable from a array without looping the objects? Similar to how call_user_func_array would work but for member variables?
E.g.
array 0 =>
object(stdClass)[402]
public 'id' => int 196
public 'creditLimit' => string '0' (length=1)
public 'state' => int 0 1 =>
object(stdClass)[403]
public 'id' => int 197
public 'creditLimit' => string '0' (length=1)
public 'state' => int 0 2 =>
object(stdClass)[404]
public 'id' => int 3269
public 'creditLimit' => string '0' (length=1)
public 'state' => int 0 3 =>
object(stdClass)[405]
public 'id' => int 3334
public 'creditLimit' => string '0' (length=1)
public 'state' => int 0 4 =>
object(stdClass)[406]
public 'id' => int 5831
public 'creditLimit' => string '0' (length=1)
public 'state' => int 0 5 =>
object(stdClass)[379]
public 'id' => int 6358
public 'creditLimit' => string '0' (length=1)
public 'state' => int 0 6 =>
object(stdClass)[400]
public 'id' => int 6592
public 'creditLimit' => string '0' (length=1)
public 'state' => int 0
In one single call I'm trying to obtain the summation of creditLimit
.
Upvotes: 0
Views: 62