Help with Array


#1

Hello everyone, i’m new on this forum, i’m not really good with php and i’m trying to retrive the values from an array, here is the code:
[php]
$Paypal->execute();

if ($Paypal->success())
{
$response = $Paypal->getAPIResponse();
}
else
{
$response = $Paypal->getAPIException();
}

var_dump($response);
[/php]

the result is this:

object(stdClass)#6 (9) { 
["Timestamp"]=> string(20) "2012-04-11T14:22:11Z" 
["Ack"]=> string(7) "Success" 
["CorrelationID"]=> string(13) "97a0fbe7a0173" 
["Version"]=> string(3) "2.4" 
["Build"]=> string(7) "2764190" 
["Amount"]=> 
object(stdClass)#7 (2) { 
["_"]=> string(5) "60.00" 
["currencyID"]=> string(3) "USD" } 
["AVSCode"]=> string(1) "X" 
["CVV2Code"]=> string(1) "M" 
["TransactionID"]=> string(17) "9NH25737N5897964X" }

Could you explain how to retrive the values?
i have try this:
[php]
foreach ($response as $obj_key =>$k)
{
echo $obj_key.’ '.$k."
";
}
[/php]

and this is the result:

Ack Success:
CorrelationID e7de0db3e618e:
Version 2.4:
Build 2764190:

Catchable fatal error: Object of class stdClass could not be converted to string
in /home/public_html/website.com/payment/paypal.php on line 229

Thank you very much for you help.


#2

;D this work fine:[php]echo $response->Ack;[/php]