Created
June 19, 2014 09:47
-
-
Save iredun/9e1323dab539ef088f1f to your computer and use it in GitHub Desktop.
Парсер XML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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