Guest User

Untitled

a guest
Feb 21st, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <file_allegati>
  2. <allegato id="0" planimetria="0" type="foto">
  3. <id>0</id>
  4. <file_path>https://##.jpg </file_path>
  5. </allegato>
  6. <allegato id="1" planimetria="1" type="planimetria">
  7. <id>1</id>
  8. <file_path>https://##.jpg </file_path>
  9. </allegato>
  10. </file_allegati>
  11.  
  12. function set_planimetrie( $allegati ) {
  13. $result="";
  14. $xml = new SimpleXMLElement($allegati);
  15.  
  16. foreach($xml->children() as $allegato)
  17. {
  18. if($allegato['type']=='planimetria' && $allegato['planimetria']==1){
  19. if( $result != ''){$result .=',';}
  20. $result.= $allegato->file_path;
  21. }
  22. return $result;
  23. }
  24. }
Add Comment
Please, Sign In to add comment