Search code examples
phpkohanagoogle-checkout

simple xml problem/google checkout... bozo


Hey guys im feeding a curl response into a simple xml object.

$xml = simplexml_load_string($redirect);

$xml.asXml() gets me this ->

<?xml version="1.0" encoding="UTF-8"?>
<checkout-redirect xmlns="http://checkout.google.com/schema/2" serial-number="9160aabc-  5efe-4f9e-bb90-71ce75d7815f">
<redirect-url>https://sandbox.google.com/checkout/view/buy?  o=shoppingcart&amp;shoppingcart=222826053769344</redirect-url>
</checkout-redirect>

when I do: $xml->redirect-url

ErrorException [ Notice ]: Use of undefined constant url - assumed 'url'
die(var_dump($xml->redirect-url));

shouldn't I be able to access it like this?


Solution

  • Can you try $xml->{'redirect-url'} ?

    I really don't know if that works, but you can give it a try :D