Posted By

udin on 06/02/13


Tagged


Versions (?)

Viglink Catalog API


 / Published in: PHP
 

Example

  1. <?php
  2. DEFINE (VIGLINK_API_KEY,'YOUR_API_KEY',true); // YOUR_API_KEY isi dg viglink API punya agan
  3. function parsing_xml($url){
  4. libxml_use_internal_errors(1);
  5. $xml = simplexml_load_file($url);
  6. $data = json_decode(json_encode($xml),true);
  7. return $data;
  8. }
  9. function viglink_get_products($query){
  10. $url = 'http://catalog.viglink.com/vigcatalog/products.xml?key=' . VIGLINK_API_KEY . '&keyword=' . urlencode($query);
  11. $data = parsing_xml($url);
  12. return $data;
  13. }
  14.  
  15. $data = viglink_get_products('dewalt');
  16. echo '<pre>';
  17. print_r($data);

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: k4ngdarma on June 3, 2013

ini cara pakenya gimana gan? saya sudah coba di localhost hasilnya kaya kode mentahan.. apa gitu saya ga paham.. mohon pencerahannya... :D

You need to login to post a comment.