I have json_decoded my paypal rest api response and gotten this:
["body"]=> object(stdClass)#4 (8) {
["id"]=> string(28) "PAY-66D616332R6551639KJLSMVQ"
["create_time"]=> string(20) "2013-10-10T22:12:38Z"
["update_time"]=> string(20) "2013-10-10T22:12:39Z"
["state"]=> string(7) "created"
["intent"]=> string(4) "sale"
["payer"]=> object(stdClass)#5 (2) {
["payment_method"]=> string(6) "paypal"
["payer_info"]=> object(stdClass)#6 (0) {}
}
["transactions"]=> array(1) {
[0]=> object(stdClass)#7 (3) {
["amount"]=> object(stdClass)#8 (3) {
["total"]=> string(6) "500.85"
["currency"]=> string(3) "USD"
["details"]=> object(stdClass)#9 (2) {
["subtotal"]=> string(6) "460.90"
["shipping"]=> string(5) "39.95"
}
}
["description"]=> string(43) "Mike and Maureen Photography - Order ID #10"
["item_list"]=> object(stdClass)#10 (1) {
["items"]=> array(2) {
[0]=> object(stdClass)#11 (5) {
["name"]=> string(48) "The Bean-8" x 10" - floating frame - black frame"
["sku"]=> string(7) "20 - 13"
["price"]=> string(6) "160.95"
["currency"]=> string(3) "USD"
["quantity"]=> string(1) "1"
}
[1]=> object(stdClass)#12 (5) {
["name"]=> string(62) "40 Steps and a View-36" x 48" - 0.75" thin gallery wrap canvas"
["sku"]=> string(5) "7 - 6"
["price"]=> string(6) "299.95"
["currency"]=> string(3) "USD"
["quantity"]=> string(1) "1"
}
}
}
}
}
["links"]=> array(3) {
[0]=> object(stdClass)#13 (3) {
["href"]=> string(79) "https://api.sandbox.paypal.com/v1/payments/payment/PAY-66D616332R6551639KJLSMVQ"
["rel"]=> string(4) "self"
["method"]=> string(3) "GET"
}
[1]=> object(stdClass)#14 (3) {
["href"]=> string(94) "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-1XB37931V5368954G"
["rel"]=> string(12) "approval_url"
["method"]=> string(8) "REDIRECT"
}
[2]=> object(stdClass)#15 (3) {
["href"]=> string(87) "https://api.sandbox.paypal.com/v1/payments/payment/PAY-66D616332R6551639KJLSMVQ/execute"
["rel"]=> string(7) "execute"
["method"]=> string(4) "POST"
}
}
}
I am trying to check the value of 'state' but I cant seem to figure out how to reference that value. I have tried: ($result is the variable where the array is located)
$result['body']['state']
$result['state']
$body['state']
None of those work, so can anyone tell me how to reference the key 'state' in that mess up there? I am usually pretty good with PHP but for some reason I can not figure this one out.
Thanks for your help.
Edit
I have formatted the response so its easier to ready but I am stuck on selecting the [1] href value. If I base it on the previous example I would use
$result['body']->link but how do I get past that to the specific href in [1]?
The formatting doesn't help, but it looks like $result['body']->state will get you what you're looking for.
You were closest with your first attempt, $result['body']['state'], however $result['body'] is an object, and so you need to use -> to access its properties.
Related
I try to var_dump my data, i got this result. what is this #949 #950 and why that #number always increase when i reload my page?
array(4) { [0]=> object(stdClass)#949 (4) { ["tanggal"]=> string(10) "2021-02-20" ["waktu"]=> string(5) "12:00" ["zoom"]=> string(5) "zoom1" ["token"]=> string(32) "4e03d86ced0713b685e66912d6287532" } [1]=> object(stdClass)#950 (4) { ["tanggal"]=> string(10) "2021-02-22" ["waktu"]=> string(5) "12:00" ["zoom"]=> string(5) "zoom3" ["token"]=> string(32) "ed5db365327bed0960e6cf7de45000ba" } [2]=> object(stdClass)#951 (4) { ["tanggal"]=> string(10) "2021-02-23" ["waktu"]=> string(5) "12:03" ["zoom"]=> string(5) "zoom4" ["token"]=> string(32) "c8a1d12016d39fd544e0497401571e5e" } [3]=> object(stdClass)#952 (4) { ["tanggal"]=> string(10) "2021-02-27" ["waktu"]=> string(5) "12:03" ["zoom"]=> string(5) "zoom5" ["token"]=> string(32) "a961c4066419aaac3afe728a704429e2" } }
this is my first time posting:
I wish to integrate PayPal API into my site, I can get the payment successfully done but not the refund part. I see an refund api in the lib folder; however, I am not sure which ID to use, I don't see a lot of examples regarding refund.
This is what I have now:
$refund = new Refund();
$refund->setId($payment_id);
$refund->setAmount(1000);
$refund->get($payment_id, $this->apiContext);
try {
//$refund = Refund::get();
} catch (Exception $ex) {
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Get Payment", "Payment", null, null, $ex);
exit(1);
}
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
return json_decode($payment, 128);
Where Payment Detail is:
array(10) {
["id"]=>
string(28) "PAY-1WL153218P032830GKZK2BLY"
["intent"]=>
string(4) "sale"
["state"]=>
string(7) "created"
["cart"]=>
string(17) "08X596883D298843B"
["payer"]=>
array(3) {
["payment_method"]=>
string(6) "paypal"
["status"]=>
string(8) "VERIFIED"
["payer_info"]=>
array(8) {
["email"]=>
string(32) "ted.chou12-facilitator#gmail.com"
["first_name"]=>
string(4) "test"
["last_name"]=>
string(11) "facilitator"
["payer_id"]=>
string(13) "GGYZW23EGRAY4"
["shipping_address"]=>
array(7) {
["recipient_name"]=>
string(16) "test facilitator"
["line1"]=>
string(22) "88 Des Voeux Road West"
["line2"]=>
string(6) "3F 520"
["city"]=>
string(9) "Hong Kong"
["state"]=>
string(9) "Hong Kong"
["postal_code"]=>
string(6) "000000"
["country_code"]=>
string(2) "HK"
}
["phone"]=>
string(10) "4088069385"
["country_code"]=>
string(2) "US"
["billing_address"]=>
array(6) {
["line1"]=>
string(22) "88 Des Voeux Road West"
["line2"]=>
string(6) "3F 520"
["city"]=>
string(9) "Hong Kong"
["state"]=>
string(9) "Hong Kong"
["postal_code"]=>
string(6) "000000"
["country_code"]=>
string(2) "HK"
}
}
}
["transactions"]=>
array(1) {
[0]=>
array(6) {
["amount"]=>
array(3) {
["total"]=>
string(7) "2340.00"
["currency"]=>
string(3) "TWD"
["details"]=>
array(3) {
["subtotal"]=>
string(7) "2310.00"
["tax"]=>
string(4) "0.00"
["shipping"]=>
string(5) "30.00"
}
}
["payee"]=>
array(1) {
["email"]=>
string(35) "jaypatel512-facilitator#hotmail.com"
}
["description"]=>
string(19) "Payment description"
["invoice_number"]=>
string(13) "5655a0adceedf"
["item_list"]=>
array(2) {
["items"]=>
array(3) {
[0]=>
array(5) {
["name"]=>
string(2) "25"
["sku"]=>
string(2) "11"
["price"]=>
string(6) "529.00"
["currency"]=>
string(3) "TWD"
["quantity"]=>
int(3)
}
[1]=>
array(5) {
["name"]=>
string(13) "Warrior Model"
["sku"]=>
string(2) "15"
["price"]=>
string(6) "180.00"
["currency"]=>
string(3) "TWD"
["quantity"]=>
int(1)
}
[2]=>
array(5) {
["name"]=>
string(7) "dim_sum"
["sku"]=>
string(2) "22"
["price"]=>
string(6) "543.00"
["currency"]=>
string(3) "TWD"
["quantity"]=>
int(1)
}
}
["shipping_address"]=>
array(7) {
["recipient_name"]=>
string(16) "test facilitator"
["line1"]=>
string(22) "88 Des Voeux Road West"
["line2"]=>
string(6) "3F 520"
["city"]=>
string(9) "Hong Kong"
["state"]=>
string(9) "Hong Kong"
["postal_code"]=>
string(6) "000000"
["country_code"]=>
string(2) "HK"
}
}
["related_resources"]=>
array(0) {
}
}
}
["redirect_urls"]=>
array(2) {
["return_url"]=>
string(97) "..."
["cancel_url"]=>
string(59) "..."
}
["create_time"]=>
string(20) "2015-11-25T11:51:10Z"
["update_time"]=>
string(20) "2015-11-25T11:51:10Z"
["links"]=>
array(3) {
[0]=>
array(3) {
["href"]=>
string(79) "..."
["rel"]=>
string(4) "self"
["method"]=>
string(3) "GET"
}
[1]=>
array(3) {
["href"]=>
string(87) ".../execute"
["rel"]=>
string(7) "execute"
["method"]=>
string(4) "POST"
}
[2]=>
array(3) {
["href"]=>
string(94) "..."
["rel"]=>
string(12) "approval_url"
["method"]=>
string(8) "REDIRECT"
}
}
}
Once you execute the payment, you will get back a sale=>id. That's the id you would use for a refund.
It will also include a full URI for you under transactions=>related_resources=>links with the 'rel' value of 'refund'.
Source: https://developer.paypal.com/docs/api/#refunds
Each of the payment will produce an sale_id as an example 4CFG677234DFG234F. This ID will be use to make a refund.
Don't get yourself confuse with the payment id and the sale_id.
I have the array like this:
} ["items":"Jcart":private]=> array(3) {
[0]=>
string(1) "3"
[1]=>
string(1) "2"
[2]=>
string(7) "ABC-123" }
How to get the "items" values in a php variable?
///////
Te complete object is:
object(Jcart)#1 (8) {
["config"]=>
array(12) {
["jcartPath"]=>
string(6) "jcart/"
["checkoutPath"]=>
string(12) "checkout.php"
["item"]=>
array(6) {
["id"]=>
string(10) "my-item-id"
["name"]=>
string(12) "my-item-name"
["price"]=>
string(13) "my-item-price"
["qty"]=>
string(11) "my-item-qty"
["url"]=>
string(11) "my-item-url"
["add"]=>
string(13) "my-add-button"
}
["paypal"]=>
array(5) {
["id"]=>
string(38) "seller_1282188508_biz#conceptlogic.com"
["https"]=>
bool(true)
["sandbox"]=>
bool(false)
["returnUrl"]=>
string(0) ""
["notifyUrl"]=>
string(0) ""
}
["currencyCode"]=>
string(3) "USD"
["csrfToken"]=>
bool(false)
["text"]=>
array(14) {
["cartTitle"]=>
string(13) "Shopping Cart"
["singleItem"]=>
string(4) "Item"
["multipleItems"]=>
string(5) "Items"
["subtotal"]=>
string(8) "Subtotal"
["update"]=>
string(6) "update"
["checkout"]=>
string(8) "checkout"
["checkoutPaypal"]=>
string(20) "Checkout with PayPal"
["removeLink"]=>
string(6) "remove"
["emptyButton"]=>
string(5) "empty"
["emptyMessage"]=>
string(19) "Your cart is empty!"
["itemAdded"]=>
string(11) "Item added!"
["priceError"]=>
string(21) "Invalid price format!"
["quantityError"]=>
string(38) "Item quantities must be whole numbers!"
["checkoutError"]=>
string(34) "Your order could not be processed!"
}
["button"]=>
array(4) {
["checkout"]=>
string(0) ""
["paypal"]=>
string(0) ""
["update"]=>
string(0) ""
["empty"]=>
string(0) ""
}
["tooltip"]=>
bool(true)
["decimalQtys"]=>
bool(false)
["decimalPlaces"]=>
int(1)
["priceFormat"]=>
array(3) {
["decimals"]=>
int(2)
["dec_point"]=>
string(1) "."
["thousands_sep"]=>
string(1) ","
}
}
["items":"Jcart":private]=>
array(2) {
[0]=>
string(1) "3"
[1]=>
string(1) "2"
}
["names":"Jcart":private]=>
array(2) {
[3]=>
string(12) "Hockey Stick"
[2]=>
string(13) "Baseball Mitt"
}
["prices":"Jcart":private]=>
array(2) {
[3]=>
string(5) "33.25"
[2]=>
string(5) "19.50"
}
["qtys":"Jcart":private]=>
array(2) {
[3]=>
string(1) "1"
[2]=>
string(2) "20"
}
["urls":"Jcart":private]=>
array(2) {
[3]=>
string(15) "http://bing.com"
[2]=>
string(16) "http://yahoo.com"
}
["subtotal":"Jcart":private]=>
float(423.25)
["itemCount":"Jcart":private]=>
int(21)
}
I just need the values in ["items":"Jcart":private]
I assume you got this by casting an object to an array. If that's the case, you shouldn't be doing that! The property is private because you're not supposed to access it directly because it's not a public API. The object should have a public method which you're supposed to call instead, that's the public API. Something like $foo->getItems() or such. Read the documentation and/or source code.
Since I stumbled over some wrong solutions (at least always pointing into the right direction) for having your instagram photos pulled onto my site, I started looking for new ways. And I had to implement SSL into the cURL scripting part to get the instagram feed.
However I am stuck in the following part: How can I tell my script to show my images?
I found out, that $result->data works, but if I continue this line with ->images PHP gives me the "Trying to get property of non-object". And the output of the decoded JSON is still lacking overviewability. I pasted here the code as far as I am right now, debugging mode.
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.instagram.com/v1/users/myUserID/media/recent/?access_token=myAccessToken');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$result = curl_exec($ch);
curl_close($ch);
$result=json_decode($result);
$data=($result->data);
var_dump ($data->images);
// echo "<img src="$result->images->thumbnail->url">"
?>
Here is the output of the json_decode:
array(2) {
[0]=> object(stdClass)#4 (15) {
["attribution"]=> NULL
["tags"]=> array(4) {
[0]=> string(5) "remix"
[1]=> string(9) "trncfrmcn"
[2]=> string(4) "tygn"
[3]=> string(9) "mastering"
}
["type"]=> string(5) "image"
["location"]=> NULL
["comments"]=> object(stdClass)#5 (2) {
["count"]=> int(0)
["data"]=> array(0) { }
}
["filter"]=> string(7) "Toaster"
["created_time"]=> string(10) "1373149059"
["link"]=> string(34) "http://instagram.com/p/bcOOGMF5Vi/"
["likes"]=> object(stdClass)#6 (2) {
["count"]=> int(6)
["data"]=> array(4) {
[0]=> object(stdClass)#7 (4) {
["username"]=> string(13) "itsallaboutva"
["profile_picture"]=> string(77)
"http://images.ak.instagram.com/profiles/profile_186336970_75sq_1341852049.jpg"
["id"]=> string(9) "186336970"
["full_name"]=> string(16) "Victoria Anwuzia"
}
[1]=> object(stdClass)#8 (4) {
["username"]=> string(15) "eatmybeatsordie"
["profile_picture"]=> string(76)
"http://images.ak.instagram.com/profiles/profile_32709002_75sq_1355602472.jpg"
["id"]=> string(8) "32709002"
["full_name"]=> string(12) "D-Mite Beats"
}
[2]=> object(stdClass)#9 (4) {
["username"]=> string(12) "joetranmusic"
["profile_picture"]=> string(76) "http://images.ak.instagram.com/profiles/profile_32545994_75sq_1362449260.jpg"
["id"]=> string(8) "32545994"
["full_name"]=> string(8) "Joe Tran"
}
[3]=> object(stdClass)#10 (4) {
["username"]=> string(14) "xariahmarshall"
["profile_picture"]=> string(77) "http://images.ak.instagram.com/profiles/profile_275171230_75sq_1362937374.jpg"
["id"]=> string(9) "275171230"
["full_name"]=> string(14) "xariahmarshall"
}
}
}
["images"]=> object(stdClass)#11 (3) {
["low_resolution"]=> object(stdClass)#12 (3) {
["url"]=> string(79) "http://distilleryimage2.s3.amazonaws.com/ded954f8e68911e2adc122000a1f9ace_6.jpg"
["width"]=> int(306)
["height"]=> int(306)
}
["thumbnail"]=> object(stdClass)#13 (3) {
["url"]=> string(79) "http://distilleryimage2.s3.amazonaws.com/ded954f8e68911e2adc122000a1f9ace_5.jpg"
["width"]=> int(150)
["height"]=> int(150)
}
["standard_resolution"]=> object(stdClass)#14 (3) {
["url"]=> string(79) "http://distilleryimage2.s3.amazonaws.com/ded954f8e68911e2adc122000a1f9ace_7.jpg"
["width"]=> int(612)
["height"]=> int(612)
}
}
["users_in_photo"]=> array(0) { }
["caption"]=> object(stdClass)#15 (4) {
["created_time"]=> string(10) "1373149155"
["text"]=> string(34) "#Mastering #TYGN #TRNCFRMCN #Remix"
["from"]=> object(stdClass)#16 (4) {
["username"]=> string(12) "liebdich9vol"
["profile_picture"]=> string(77) "http://images.ak.instagram.com/profiles/profile_444541508_75sq_1372633384.jpg"
["id"]=> string(9) "444541508"
["full_name"]=> string(11) "Ian Maybach"
}
["id"]=> string(18) "494333402642093342"
}
["user_has_liked"]=> bool(false)
["id"]=> string(28) "494332600473064802_444541508"
["user"]=> object(stdClass)#17 (6) {
["username"]=> string(12) "liebdich9vol"
["website"]=> string(0) ""
["profile_picture"]=> string(77) "http://images.ak.instagram.com/profiles/profile_444541508_75sq_1372633384.jpg"
["full_name"]=> string(11) "Ian Maybach"
["bio"]=> string(0) ""
["id"]=> string(9) "444541508"
}
}
[1]=> object(stdClass)#18 (15) {
["attribution"]=> NULL
["tags"]=> array(3) {
[0]=> string(6) "studio"
[1]=> string(6) "garden"
[2]=> string(4) "view"
}
["type"]=> string(5) "image"
["location"]=> NULL
["comments"]=> object(stdClass)#19 (2) {
["count"]=> int(0)
["data"]=> array(0) { }
}
["filter"]=> string(7) "Toaster"
["created_time"]=> string(10) "1372661045"
["link"]=> string(34) "http://instagram.com/p/bNrZ-sl5Xp/"
["likes"]=> object(stdClass)#20 (2) {
["count"]=> int(4)
["data"]=> array(4) {
[0]=> object(stdClass)#21 (4) {
["username"]=> string(9) "seanbabas"
["profile_picture"]=> string(76) "http://images.ak.instagram.com/profiles/profile_30025104_75sq_1369077409.jpg"
["id"]=> string(8) "30025104"
["full_name"]=> string(10) "Sean Babas"
}
[1]=> object(stdClass)#22 (4) {
["username"]=> string(12) "ginocolletti"
["profile_picture"]=> string(75) "http://images.ak.instagram.com/profiles/profile_4634400_75sq_1364847565.jpg"
["id"]=> string(7) "4634400"
["full_name"]=> string(13) "Gino Colletti"
}
[2]=> object(stdClass)#23 (4) {
["username"]=> string(13) "marygraceklee"
["profile_picture"]=> string(75) "http://images.ak.instagram.com/profiles/profile_3269702_75sq_1373251095.jpg"
["id"]=> string(7) "3269702"
["full_name"]=> string(13) "Marygrace Lee"
}
[3]=> object(stdClass)#24 (4) {
["username"]=> string(10) "cyonthefly"
["profile_picture"]=> string(77) "http://images.ak.instagram.com/profiles/profile_225204950_75sq_1368426695.jpg"
["id"]=> string(9) "225204950"
["full_name"]=> string(21) "!CY ÊŽlÉŸÇɥʇuo ✈"
}
}
}
["images"]=> object(stdClass)#25 (3) {
["low_resolution"]=> object(stdClass)#26 (3) {
["url"]=> string(79) "http://distilleryimage9.s3.amazonaws.com/9f5f0300e21911e2929322000a9e0719_6.jpg"
["width"]=> int(306)
["height"]=> int(306)
}
["thumbnail"]=> object(stdClass)#27 (3) {
["url"]=> string(79) "http://distilleryimage9.s3.amazonaws.com/9f5f0300e21911e2929322000a9e0719_5.jpg"
["width"]=> int(150)
["height"]=> int(150)
}
["standard_resolution"]=> object(stdClass)#28 (3) {
["url"]=> string(79) "http://distilleryimage9.s3.amazonaws.com/9f5f0300e21911e2929322000a9e0719_7.jpg"
["width"]=> int(612)
["height"]=> int(612)
}
}
["users_in_photo"]=> array(0) { }
["caption"]=> object(stdClass)#29 (4) {
["created_time"]=> string(10) "1372900093"
["text"]=> string(21) "#studio #view #garden"
["from"]=> object(stdClass)#30 (4) {
["username"]=> string(12) "liebdich9vol"
["profile_picture"]=> string(77) "http://images.ak.instagram.com/profiles/profile_444541508_75sq_1372633384.jpg"
["id"]=> string(9) "444541508"
["full_name"]=> string(11) "Ian Maybach"
}
["id"]=> string(18) "492244118468531915"
}
["user_has_liked"]=> bool(false)
["id"]=> string(28) "490238835760272873_444541508"
["user"]=> object(stdClass)#31 (6) {
["username"]=> string(12) "liebdich9vol"
["website"]=> string(0) ""
["profile_picture"]=> string(77) "http://images.ak.instagram.com/profiles/profile_444541508_75sq_1372633384.jpg"
["full_name"]=> string(11) "Ian Maybach"
["bio"]=> string(0) ""
["id"]=> string(9) "444541508"
}
}
}
My aim is to have only one picture on my site but navigation arrows to switch to the next one. How would that be achieved?
To access infos from StdClass you can do this:
foreach($data->images as $i){
$i->url;
}
You can force a casting to array too:
foreach($data->images as $i){
$i = $i->toArray();
$i['url'];
}
And you can get the json decode on array form:
$data = json_decode($json,true); //the second param true means, bring me it like array.
as per http://php.net/json_decode, you need to specify you want an associative array instead of an object from json_decode:
so use json decode like this
$result=json_decode($result, true);
Now you will get array and you can easily access data.
I received this XML data and var_dumped it.
How do I use this now and fetch one of the records from inside? like $this->{product}->name etc.?
object(SimpleXMLElement)#189 (1) { ["products"]=> object(SimpleXMLElement)#188 (2) { ["#attributes"]=> array(3) { ["total-matched"]=> string(1) "3" ["records-returned"]=> string(1) "3" ["page-number"]=> string(1) "1" } ["product"]=> array(3) { [0]=> object(SimpleXMLElement)#206 (19) { ["ad-id"]=> string(8) "10581256" ["advertiser-id"]=> string(7) "2466656" ["advertiser-name"]=> string(18) "Everydaysource.com" ["advertiser-category"]=> string(21) "MP3 Accessories>Cases" ["buy-url"]=> string(245) "http://www.kqzyfj.com/click-4107027-10581256?url=http%3A%2F%2Fwww.everydaysource.com%2Fproduct%2Fsnap-on-case-compatible-with-apple-ipod-touch-4th-gen-colorful-zebra%2Fdapptoucco62%3Fesaffcojudtf120626%3Daf%2Bcj%2Bdapptoucco62&cjsku=DAPPTOUCCO62" ["catalog-id"]=> string(8) "cjo:2691" ["currency"]=> string(3) "USD" ["description"]=> string(57) "Compatible With Apple®:iPod touch® 4th Generation" ["image-url"]=> string(73) "http://cdn1.everydaysource.com/cdn2/110207/fb/28/d2/dapptoucco62_1_es.jpg" ["in-stock"]=> object(SimpleXMLElement)#98 (0) { } ["isbn"]=> object(SimpleXMLElement)#99 (0) { } ["manufacturer-name"]=> string(14) "EverydaySource" ["manufacturer-sku"]=> string(12) "DAPPTOUCCO62" ["name"]=> string(69) "Snap-on Case Compatible with Apple iPod Touch 4th Gen,Colorful Zebra" ["price"]=> string(4) "8.99" ["retail-price"]=> string(3) "0.0" ["sale-price"]=> string(3) "0.0" ["sku"]=> string(12) "DAPPTOUCCO62" ["upc"]=> string(12) "628569324674" } [1]=> object(SimpleXMLElement)#100 (19) { ["ad-id"]=> string(8) "10402409" ["advertiser-id"]=> string(7) "1636472" ["advertiser-name"]=> string(8) "Eforcity" ["advertiser-category"]=> string(21) "MP3 Accessories>Cases" ["buy-url"]=> string(233) "http://www.jdoqocy.com/click-4107027-10402409?url=http%3A%2F%2Fwww.eforcity.com%2Fsnap-on-case-compatible-with-apple-ipod-touch-4th-gen-colorful-zebra-dapptoucco62.html%3Fefaffcojudtf120626%3Daf%2Bcj%2Bdapptoucco62&cjsku=DAPPTOUCCO62" ["catalog-id"]=> string(8) "cjo:1136" ["currency"]=> string(3) "USD" ["description"]=> string(57) "Compatible With Apple®:iPod touch® 4th Generation" ["image-url"]=> string(68) "http://cdn1.eforcity.com/cdn2/110101/41/86/a3/dapptoucco62_1_efc.jpg" ["in-stock"]=> object(SimpleXMLElement)#99 (0) { } ["isbn"]=> object(SimpleXMLElement)#98 (0) { } ["manufacturer-name"]=> string(8) "eForCity" ["manufacturer-sku"]=> string(12) "DAPPTOUCCO62" ["name"]=> string(69) "Snap-on Case Compatible with Apple iPod Touch 4th Gen,Colorful Zebra" ["price"]=> string(4) "7.99" ["retail-price"]=> string(3) "0.0" ["sale-price"]=> string(3) "0.0" ["sku"]=> string(12) "DAPPTOUCCO62" ["upc"]=> string(12) "628569324674" } [2]=> object(SimpleXMLElement)#101 (19) { ["ad-id"]=> string(8) "10581247" ["advertiser-id"]=> string(7) "2466659" ["advertiser-name"]=> string(15) "iTrimming Corp." ["advertiser-category"]=> string(21) "MP3 Accessories>Cases" ["buy-url"]=> string(165) "http://www.dpbolvw.net/click-4107027-10581247?url=http%3A%2F%2Fwww.itrimming.com%2Fdapptoucco62.html%3Fitaffcojudtf120626%3Daf%2Bcj%2Bdapptoucco62&cjsku=DAPPTOUCCO62" ["catalog-id"]=> string(8) "cjo:2690" ["currency"]=> string(3) "USD" ["description"]=> string(57) "Compatible With Apple®:iPod touch® 4th Generation" ["image-url"]=> string(68) "http://cdn1.itrimming.com/cdn2/110301/c9/cc/33/dapptoucco62_1_it.jpg" ["in-stock"]=> object(SimpleXMLElement)#98 (0) { } ["isbn"]=> object(SimpleXMLElement)#99 (0) { } ["manufacturer-name"]=> string(9) "iTrimming" ["manufacturer-sku"]=> string(12) "DAPPTOUCCO62" ["name"]=> string(69) "Snap-on Case Compatible with Apple iPod Touch 4th Gen,Colorful Zebra" ["price"]=> string(4) "7.59" ["retail-price"]=> string(3) "0.0" ["sale-price"]=> string(3) "0.0" ["sku"]=> string(12) "DAPPTOUCCO62" ["upc"]=> string(12) "628569324674" } } } }
Pastebin of the same : http://pastebin.com/XYN8ysEG
Thank you!
** Edit **
Here is the raw data
object(SimpleXMLElement)#189 (1) {
["products"]=>
object(SimpleXMLElement)#188 (2) {
["#attributes"]=>
array(3) {
["total-matched"]=>
string(1) "4"
["records-returned"]=>
string(1) "4"
["page-number"]=>
string(1) "1"
}
["product"]=>
array(4) {
[0]=>
object(SimpleXMLElement)#206 (19) {
["ad-id"]=>
string(8) "10450940"
["advertiser-id"]=>
string(7) "1427863"
["advertiser-name"]=>
string(12) "Bookbyte.com"
["advertiser-category"]=>
string(5) "Books"
["buy-url"]=>
string(151) "http://www.anrdoezrs.net/click-4107027-10450940?url=http%3A%2F%2Fwww.bookbyte.com%2Fproduct.aspx%3Fisbn%3D1576751740%26noredirect%3Dtrue&cjsku=13671976"
["catalog-id"]=>
string(8) "cjo:1574"
["currency"]=>
string(3) "USD"
["description"]=>
string(34) "This book is in Like New condition"
["image-url"]=>
object(SimpleXMLElement)#77 (0) {
}
["in-stock"]=>
object(SimpleXMLElement)#74 (0) {
}
["isbn"]=>
string(10) "1576751740"
["manufacturer-name"]=>
object(SimpleXMLElement)#75 (0) {
}
["manufacturer-sku"]=>
object(SimpleXMLElement)#72 (0) {
}
["name"]=>
string(53) "Leadership and Self Deception: Getting Out of the Box"
["price"]=>
string(4) "13.5"
["retail-price"]=>
string(5) "14.95"
["sale-price"]=>
string(3) "0.0"
["sku"]=>
string(8) "13671976"
["upc"]=>
object(SimpleXMLElement)#73 (0) {
}
}
[1]=>
object(SimpleXMLElement)#78 (19) {
["ad-id"]=>
string(8) "10450940"
["advertiser-id"]=>
string(7) "1427863"
["advertiser-name"]=>
string(12) "Bookbyte.com"
["advertiser-category"]=>
string(5) "Books"
["buy-url"]=>
string(148) "http://www.jdoqocy.com/click-4107027-10450940?url=http%3A%2F%2Fwww.bookbyte.com%2Fproduct.aspx%3Fisbn%3D1576751740%26noredirect%3Dtrue&cjsku=1084348"
["catalog-id"]=>
string(8) "cjo:1574"
["currency"]=>
string(3) "USD"
["description"]=>
string(41) "This book is in New - Excellent condition"
["image-url"]=>
object(SimpleXMLElement)#73 (0) {
}
["in-stock"]=>
object(SimpleXMLElement)#72 (0) {
}
["isbn"]=>
string(10) "1576751740"
["manufacturer-name"]=>
object(SimpleXMLElement)#75 (0) {
}
["manufacturer-sku"]=>
object(SimpleXMLElement)#74 (0) {
}
["name"]=>
string(53) "Leadership and Self Deception: Getting Out of the Box"
["price"]=>
string(5) "11.21"
["retail-price"]=>
string(5) "14.95"
["sale-price"]=>
string(3) "0.0"
["sku"]=>
string(7) "1084348"
["upc"]=>
object(SimpleXMLElement)#77 (0) {
}
}
[2]=>
object(SimpleXMLElement)#79 (19) {
["ad-id"]=>
string(8) "10450940"
["advertiser-id"]=>
string(7) "1427863"
["advertiser-name"]=>
string(12) "Bookbyte.com"
["advertiser-category"]=>
string(5) "Books"
["buy-url"]=>
string(148) "http://www.kqzyfj.com/click-4107027-10450940?url=http%3A%2F%2Fwww.bookbyte.com%2Fproduct.aspx%3Fisbn%3D1576751740%26noredirect%3Dtrue&cjsku=12530742"
["catalog-id"]=>
string(8) "cjo:1574"
["currency"]=>
string(3) "USD"
["description"]=>
string(34) "This book is in Like New condition"
["image-url"]=>
object(SimpleXMLElement)#77 (0) {
}
["in-stock"]=>
object(SimpleXMLElement)#74 (0) {
}
["isbn"]=>
string(10) "1576751740"
["manufacturer-name"]=>
object(SimpleXMLElement)#75 (0) {
}
["manufacturer-sku"]=>
object(SimpleXMLElement)#72 (0) {
}
["name"]=>
string(53) "Leadership and Self Deception: Getting Out of the Box"
["price"]=>
string(5) "29.25"
["retail-price"]=>
string(5) "14.95"
["sale-price"]=>
string(3) "0.0"
["sku"]=>
string(8) "12530742"
["upc"]=>
object(SimpleXMLElement)#73 (0) {
}
}
[3]=>
object(SimpleXMLElement)#76 (19) {
["ad-id"]=>
string(8) "10586024"
["advertiser-id"]=>
string(7) "2172304"
["advertiser-name"]=>
string(5) "Chegg"
["advertiser-category"]=>
string(45) "Media > Books > Non-Fiction > Education Books"
["buy-url"]=>
string(116) "http://www.dpbolvw.net/click-4107027-10586024?url=http%3A%2F%2Fwww.chegg.com%2Fdetails%2F1576751740&cjsku=1576751740"
["catalog-id"]=>
string(8) "cjo:2718"
["currency"]=>
string(3) "USD"
["description"]=>
string(584) "The disease of self-deception (acting in ways contrary to what one knows is right) underlies all leadership problems in today's organizations, according to the premise of this work. However well intentioned they may be, leaders who deceive themselves always end up undermining their own performance.This straightforward book explains how leaders can discover their own self-deceptions and learn how to escape destructive patterns. The authors demonstrate that breaking out of these patterns leads to improved teamwork, commitment, trust, communication, motivation, and leadership."
["image-url"]=>
string(53) "http://c.chegg.com/covers2/10000/15246_1307127219.jpg"
["in-stock"]=>
object(SimpleXMLElement)#73 (0) {
}
["isbn"]=>
string(10) "1576751740"
["manufacturer-name"]=>
string(9) "chegg.com"
["manufacturer-sku"]=>
object(SimpleXMLElement)#72 (0) {
}
["name"]=>
string(29) "Leadership and Self-Deception"
["price"]=>
string(4) "9.99"
["retail-price"]=>
string(5) "15.95"
["sale-price"]=>
string(3) "0.0"
["sku"]=>
string(10) "1576751740"
["upc"]=>
string(13) "9781576751749"
}
}
}
}
they are Objects (SimpleXMLElement)
$result->products->product[0]->name