I have following array of stdClass Object
structure and want count number of offers. Std class is received as a response from third party API so it is dynamic.
stdClass Object
(
[Offer] => Array
(
[0] => stdClass Object
(
[Offerid] => 1
[LoanAmount] => 2****
[InterestRate] => 2*
[Term] => 36
[MonthlyPayment] => 7***
[Annualfee] => 0
[OriginationFee] => 1***
)
[1] => stdClass Object
(
[Offerid] => 1
[LoanAmount] => 2****
[InterestRate] => 2*
[Term] => 36
[MonthlyPayment] => 7***
[Annualfee] => 0
[OriginationFee] => 1***
)
[2] => stdClass Object
(
[Offerid] => 1
[LoanAmount] => 2****
[InterestRate] => 2*
[Term] => 36
[MonthlyPayment] => 7***
[Annualfee] => 0
[OriginationFee] => 1***
)
)
)
i want count number of arrays in [Offer], for that i have done following:
echo "count----------".count($offers);
but it gives 1 as a count like
count----------1
in this case count is 3 and i want 3 as output.
Please suggests.
i have also used this
echo "count----------".count((array)$offers);
This also dont works.