Advertisement
fahmihilmansyah

Untitled

Jan 6th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. $txt = "<?xml version='1.0' encoding='utf-8'?>
  2. <transactions_response>
  3.   <data>
  4.     <trx>
  5.       <msisdn/>
  6.       <product_type>GAME</product_type>
  7.       <management_code>838873402</management_code>
  8.       <voucher_code>QV9TP-B0UIF-VGU3O-1G0Z1-S3PT7</voucher_code>
  9.       <serial_number>6113420739</serial_number>
  10.       <voucher_password/>
  11.       <pin/>
  12.     </trx>
  13.   </data>
  14. </transactions_response>";
  15. $xml_res = simplexml_load_string($txt) or die("Format Salah");
  16. echo "<br><pre>";
  17. print_r($xml_res);
  18. $xml_res = (array)$xml_res;
  19. $xml_res = (array)$xml_res['data']->trx;
  20. print_r($xml_res['voucher_code']);
  21. print_r($xml_res['voucher_password']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement