Skip to content

Instantly share code, notes, and snippets.

@iredun
Created June 19, 2014 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iredun/9e1323dab539ef088f1f to your computer and use it in GitHub Desktop.
Save iredun/9e1323dab539ef088f1f to your computer and use it in GitHub Desktop.
Парсер XML
<?php
$uploadfile="<Root><Boobs><B1>ffff<B1></Boobs></Root>"
$dom = new domDocument;
$file=file_get_contents($uploadfile);
$dom->loadXML($file);
if (!$dom) {
echo 'Ошибка при обработке';
exit;
}
$s = simplexml_import_dom($dom);
echo $s->Boobs[0]->B1;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment