![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 13 Pomógł: 0 Dołączył: 26.12.2011 Ostrzeżenie: (0%) ![]() ![]() |
Witam!
Mam problem z wyciągnięciem potrzebnych danych z pliku xml, plik ma taką zawartość Kod <?xml version="1.0"?> <player name="Danon" account="111111" exp="770738"></player> Chciałbym z niego wyciągnąć name oraz exp. Próbuję wyciągnąć te dane przez "simplexml" lecz nie udaje mi się to, ponieważ wynik jest pusty. Dzięki za pomoc |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 13 Pomógł: 0 Dołączył: 26.12.2011 Ostrzeżenie: (0%) ![]() ![]() |
Kod <?php $sciezka = file_get_contents('spells.xml'); $str1 = preg_replace('<!--// Instant \\-->', '<instant>', $sciezka); $str2 = preg_replace('<!--\\ End Instant //-->', '</instant>', $str1); $xml = simplexml_load_string($str2); ?> Takie coś? Ten post edytował Danon910 31.12.2012, 13:09:29 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 14.10.2025 - 11:37 |