Guest User

Untitled

a guest
May 18th, 2016
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $xml= '<goods>
  4. <good sh="1235643" name="qwezxc" ed="dsa" cost="98754"/> <good sh="123" name="qwe" ed="oopopop" cost="123456"/>
  5. <good sh="1235643" name="qwezxc" ed="dsa" cost="98754"/> <good sh="123" name="qwe" ed="oopopop" cost="123456"/>
  6. <good sh="1235643" name="qwezxc" ed="dsa" cost="98754"/> <good sh="123" name="qwe" ed="oopopop" cost="123456"/>
  7. <good sh="1235643" name="qwezxc" ed="dsa" cost="98754"/> <good sh="123" name="qwe" ed="oopopop" cost="123456"/>
  8. <good sh="1235643" name="qwezxc" ed="dsa" cost="98754"/> <good sh="123" name="qwe" ed="oopopop" cost="123456"/>
  9. <good sh="1235643" name="qwezxc" ed="dsa" cost="98754"/> <good sh="123" name="qwe" ed="oopopop" cost="123456"/>
  10. <good sh="1235643" name="qwezxc" ed="dsa" cost="98754"/> <good sh="123" name="qwe" ed="oopopop" cost="123456"/>
  11. <good sh="1235643" name="qwezxc" ed="dsa" cost="98754"/> <good sh="123" name="qwe" ed="oopopop" cost="123456"/>
  12.  
  13. </goods>';
  14.  
  15. $xml = simplexml_load_string($xml);
  16.  
  17. //var_dump($xml);
  18.  
  19. foreach ($xml->children() as $good){ //получаем контейнер goods
  20. var_dump($good);
  21.     //sql здесь
  22.  
  23.    
  24. }
RAW Paste Data