PHPでオブジェクトの変数にアクセスする正しい方法は何ですか? これらは機能していないようです。
$response = $wepay->request('checkout/create', array(
'account_id' => $account_id,
'amount' => '24.95',
'short_description' => 'A brand new soccer ball',
'type' => 'GOODS',
'mode' => 'regular'
));
// display the response
print_r($response);
//prints stdClass Object ( [checkout_id] => 466761864 [checkout_uri] => https://stage.wepay.com/api/checkout/466761864/6c60270d )
echo $response[checkout_id]; //nothing
echo $response->$checkout_id; //nothing
var_dump(get_object_vars($response)); //nothing
$response から [checkout_id] と [checkout_uri] を取得するだけです。私はphpオブジェクトを初めて使用しますが、周りを見回すと、これらはすべて人々がそれを行うと言った方法であり、この場合は機能していません. これが簡単な場合は申し訳ありません。