1

I am getting data from XML file into an array and I want to show it in a readable format for the user so he can understand the result i will show to them . This is what I am getting from my XML file in array format

SimpleXMLElement Object
  (
  [@attributes] => Array
  (
  [ID] => xmlReport
  )

  [root] => SimpleXMLElement Object
  (
  [record] => Array
  (
  [0] => SimpleXMLElement Object
  (
  [@attributes] => Array
  (
  [no] => 1
  )

  [sol_id] => 0413
  [acctNum] => 041305500446
  [tran_date] => 22-DEC-2016
  [tran_particular] => B/F
  [tran_rmks] => -
  [instrmnt_num] => -
  [part_tran_type] => -
  [dr_tran_amt] => -
  [cr_tran_amt] => -
  [bal_amt] => 15212.75
  [ini_sol_desc] => -
  )

  [1] => SimpleXMLElement Object
  (
  [@attributes] => Array
  (
  [no] => 2
  )

  [sol_id] => 0413
  [acctNum] => 041305500446
  [tran_date] => 23-Dec-2016
  [tran_particular] => AKC MOTORS /009557/HDFC
  [tran_rmks] => SMS FACTORY
  [instrmnt_num] => -
  [part_tran_type] => C
  [dr_tran_amt] => 0.00
  [cr_tran_amt] => 8000.00
  [bal_amt] => 23212.75
  [ini_sol_desc] => RPC - LUDHIANA
  )

  [2] => SimpleXMLElement Object
  (
  [@attributes] => Array
  (
  [no] => 3
  )

  [sol_id] => 0413
  [acctNum] => 041305500446
  [tran_date] => 26-Dec-2016
  [tran_particular] => TRFR FROM*MAGNIFIQUE GROUP
  [tran_rmks] => -
  [instrmnt_num] => -
  [part_tran_type] => C
  [dr_tran_amt] => 0.00
  [cr_tran_amt] => 20000.00
  [bal_amt] => 43212.75
  [ini_sol_desc] => MODEL TOWN LUDHIANA
  )

  [3] => SimpleXMLElement Object
  (
  [@attributes] => Array
  (
  [no] => 4
  )

  [sol_id] => 0413
  [acctNum] => 041305500446
  [tran_date] => 28-Dec-2016
  [tran_particular] => BHARTI AIRTEL LTD
  [tran_rmks] => The zone serial is [ 15].
  [instrmnt_num] => 44936
  [part_tran_type] => D
  [dr_tran_amt] => 3663.00
  [cr_tran_amt] => 0.00
  [bal_amt] => 39549.75
  [ini_sol_desc] => RPC - LUDHIANA
  )

  )

  )

  )

and the result i want

 sol_id : 0413
  acctNum : 041305500446

and so on

jayant rawat
  • 305
  • 4
  • 19
  • Possible duplicate of [How do you parse and process HTML/XML in PHP?](http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php) – ThW Dec 29 '16 at 10:34

0 Answers0