Skip to content

Instantly share code, notes, and snippets.

@fl3xice
Last active August 3, 2019 12:49
Show Gist options
  • Save fl3xice/40016e319450db5f58d601a43513d4a4 to your computer and use it in GitHub Desktop.
Save fl3xice/40016e319450db5f58d601a43513d4a4 to your computer and use it in GitHub Desktop.
Урок Как парсить XML файлы
<?php
## Урок как парсить XML файл?
## Вся информация была получена с сайта php.net
$xmlstring = file_get_contents("file.xml");
$xml = simplexml_load_string($xmlstring);
print_r($xml);
$jsonXML = json_encode($xml);
$xml = json_decode($jsonXML, true);
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
print_r($xml);
//echo $xml['b']['line'][1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment