Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $xml = '<digiseller.request><category><id>99534</id></category><seller><id>748883</id></seller><pages><num></num><rows></rows></pages><products><order></order><currency></currency></products><lang>ru-RU</lang></digiseller.request>';
- $url = 'http://shop.digiseller.ru/xml/shop_products.asp';
- $curl = curl_init($url);
- curl_setopt ($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- $result = curl_exec($curl);
- curl_close($curl);
- $array_data = json_decode(json_encode(simplexml_load_string($result)), true);
- $item_counter = 0;
- print_r ($array_data);
- while ($array_data['products']['product'][$item_counter]['id'] != '') {
- print_r ($array_data['products']['product'][$item_counter]['name']);
- $item_counter = $item_counter + 1;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement