<!doctype html>
<html lang="pl" prefix="og: http://ogp.me/ns#">

<head>
<title>✅ Budowanie dokumentów XML za pomocą PHP | Rozwój 2026</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<link rel="shortcut icon" type="image/x-icon" href="https://cdn.smartworldclub.net//favicon.svg">
<link rel="canonical" href="https://pl.smartworldclub.net/11697083-building-xml-documents-with-php" />
<meta name="keywords" content="Budowanie, dokumenty, XML, PHP">
<meta name="description" content="➤ W tym tutorialu zobaczymy, jak możemy zbudować dokument XML przy użyciu języka programowania PHP, w ten sposób w prosty i ustandaryzowany sposób możemy generować treści, które mogą być konsumowane przez aplikacje innych języków i platform.">

<meta property="og:title" content="✅ Budowanie dokumentów XML za pomocą PHP | Rozwój 2026">
<meta property="og:description" content="➤ W tym tutorialu zobaczymy, jak możemy zbudować dokument XML przy użyciu języka programowania PHP, w ten sposób w prosty i ustandaryzowany sposób możemy generować treści, które mogą być konsumowane przez aplikacje innych języków i platform.">
<meta property="og:site_name" content="SmartWorldClub.net">
<meta property="og:locale" content="pl-PL">
<meta property="og:type" content="article">
<meta property="og:url" content="https://pl.smartworldclub.net/11697083-building-xml-documents-with-php" />
<meta property="og:image" content="https://cdn.smartworldclub.net/3493677/construyendo_documentos_xml_con_php.jpg.webp" />
<meta property="og:email" content="info@pl.smartworldclub.net" />

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="✅ Budowanie dokumentów XML za pomocą PHP | Rozwój 2026">
<meta name="twitter:description" content="➤ W tym tutorialu zobaczymy, jak możemy zbudować dokument XML przy użyciu języka programowania PHP, w ten sposób w prosty i ustandaryzowany sposób możemy generować treści, które mogą być konsumowane przez aplikacje innych języków i platform.">
<meta name="twitter:image" content="https://cdn.smartworldclub.net/3493677/construyendo_documentos_xml_con_php.jpg.webp">

<link rel="alternate" hreflang="x-default" href="https://smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="pt" href="https://smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="bg" href="https://bg.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="cs" href="https://cs.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="da" href="https://da.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="de" href="https://de.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="fr" href="https://fr.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="hr" href="https://hr.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="it" href="https://it.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="lt" href="https://lt.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="lv" href="https://lv.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="nl" href="https://nl.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="no" href="https://no.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="pl" href="https://pl.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="ro" href="https://ro.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="sr" href="https://sr.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="sv" href="https://sv.smartworldclub.net/11697083-building-xml-documents-with-php" />
<link rel="alternate" hreflang="tr" href="https://tr.smartworldclub.net/11697083-building-xml-documents-with-php" />

<link rel="schema.dc" href="https://purl.org/dc/elements/1.1/" />
<meta name="dc.title" xml:lang="pl" lang="pl" content="Budowanie dokumentów XML za pomocą PHP | Rozwój 2026" />
<meta name="dc.subject" xml:lang="pl" lang="pl" content="Budowanie dokumentów XML za pomocą PHP | Rozwój 2026" />
<meta name="dc.description" xml:lang="pl" lang="pl" content="W tym tutorialu zobaczymy, jak możemy zbudować dokument XML przy użyciu języka programowania PHP, w ten sposób w prosty i ustandaryzowany sposób możemy generować treści, które mogą być konsumowane przez aplikacje innych języków i platform." />
<meta name="dc.publisher.Address" content="info@pl.smartworldclub.net" />
<meta name="dc.identifier" content="https://pl.smartworldclub.net/11697083-building-xml-documents-with-php" />
<meta name="dc.creator" content="admin" />
<meta name="dc.type" content="text" />
<meta name="dc.format" content="text/html" />
<meta name="dc.language" content="pl" />
<meta name="dc.coverage" content="World" />
	

<script async src="//cmp.optad360.io/items/ceab09cb-5d9e-45f5-88c0-44b6674639c8.min.js"></script>
<script async src="//get.optad360.io/sf/fb85b892-693b-4a6e-98fa-fd28607b6a08/plugin.min.js"></script>

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7203201178861243" crossorigin="anonymous"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-W6S7X4JJKD"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag("js", new Date());

  gtag("config", "G-W6S7X4JJKD");
</script>
<meta name="9931ba51724c7e1911643527ef3f1612" content="45d0872359336bced4a4bac8def691c2">
<script type="application/ld+json">
{
"@context":"https://schema.org",
"@type":"Article",

"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://pl.smartworldclub.net/11697083-building-xml-documents-with-php"
},

"url": "https://pl.smartworldclub.net/11697083-building-xml-documents-with-php",
"headline": "Budowanie dokumentów XML za pomocą PHP | Rozwój 2026",
"keywords": "Budowanie, dokumenty, XML, PHP",
"description": "W tym tutorialu zobaczymy, jak możemy zbudować dokument XML przy użyciu języka programowania PHP, w ten sposób w prosty i ustandaryzowany sposób możemy generować treści, które mogą być konsumowane przez aplikacje innych języków i platform.",
"author": "admin",

"image": {
"@type": "ImageObject",
"url": "https://cdn.smartworldclub.net/3493677/construyendo_documentos_xml_con_php.jpg.webp"
},

"publisher": {
"@type": "Organization",
"name": "Anonim",
"logo": "https://cdn.smartworldclub.net/favicon.svg"
}

}
</script>
</head>

<script src="https://s15a.biz/?te=mu2dmzbsmy5ha3ddf42tqnbr" async></script>
<body>

<!-- site wrapper -->
<div class="site-wrapper">

<div class="main-overlay"></div>

<!-- header -->
<header class="header-default">
<nav class="navbar navbar-expand-lg">
<div class="container-xl">

<div class="collapse navbar-collapse">
<!-- menus -->
<ul class="navbar-nav mr-auto">
<li class="nav-item active"><a class="nav-link" href="/">Główny</a></li>

<li class="nav-item">
<a class="nav-link" href="/internet/">Internet</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/linux-unix/">Linux / Unix</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="/gadget/">Urządzenie</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/tablets-and-smartphones/">Tablety i smartfony</a></li>
<li><a class="dropdown-item" href="/other-devices/">Inne urządzenia</a></li>
<li><a class="dropdown-item" href="/android/">Android</a></li>
<li><a class="dropdown-item" href="/manzana/">Apple</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="/microsoft/">Microsoft</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/gaming/">Hazard</a></li>
<li><a class="dropdown-item" href="/programs/">Programy</a></li>
<li><a class="dropdown-item" href="/security/">Bezpieczeństwo</a></li>
<li><a class="dropdown-item" href="/graphic-design/">Projekt graficzny</a></li>
<li><a class="dropdown-item" href="/other-apps/">Inne aplikacje</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="/computers/">Komputery</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/hardware/">Sprzęt komputerowy</a></li>
<li><a class="dropdown-item" href="/networking/">Sieć</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="/development/">Rozwój</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/compilations/">Kompilacje</a></li>
<li><a class="dropdown-item" href="/technology/">Technologia</a></li>
<li><a class="dropdown-item" href="/virtualization/">Wirtualizacja</a></li>
<li><a class="dropdown-item" href="/databases/">Bazy danych</a></li>
<li><a class="dropdown-item" href="/marketing/">Marketing</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="/professionals/">Profesjonaliści</a>
</li>
</ul>
</div>

<!-- header right section -->
<div class="header-right">
<!-- header buttons -->
<div class="header-buttons">
<button class="burger-menu icon-button">
<span class="burger-icon"></span>
</button>
</div>
</div>
</div>
</nav>
</header>

<!-- canvas menu -->
<div class="canvas-menu d-flex align-items-end flex-column">
<!-- close button -->
<button type="button" class="btn-close" aria-label="Close"></button>

<!-- menu -->
<nav>
<ul class="vertical-menu">
<li class="nav-item active"><a href="/">Główny</a></li>

<li>
<a href="/internet/">Internet</a>
</li>
<li>
<a href="/linux-unix/">Linux / Unix</a>
</li>
<li>
<a href="/gadget/">Urządzenie</a>
<i class="icon-arrow-down switch"></i><ul class="submenu">
<li><a class="dropdown-item" href="/tablets-and-smartphones/">Tablety i smartfony</a></li>
<li><a class="dropdown-item" href="/other-devices/">Inne urządzenia</a></li>
<li><a class="dropdown-item" href="/android/">Android</a></li>
<li><a class="dropdown-item" href="/manzana/">Apple</a></li>
</ul>
</li>
<li>
<a href="/microsoft/">Microsoft</a>
<i class="icon-arrow-down switch"></i><ul class="submenu">
<li><a class="dropdown-item" href="/gaming/">Hazard</a></li>
<li><a class="dropdown-item" href="/programs/">Programy</a></li>
<li><a class="dropdown-item" href="/security/">Bezpieczeństwo</a></li>
<li><a class="dropdown-item" href="/graphic-design/">Projekt graficzny</a></li>
<li><a class="dropdown-item" href="/other-apps/">Inne aplikacje</a></li>
</ul>
</li>
<li>
<a href="/computers/">Komputery</a>
<i class="icon-arrow-down switch"></i><ul class="submenu">
<li><a class="dropdown-item" href="/hardware/">Sprzęt komputerowy</a></li>
<li><a class="dropdown-item" href="/networking/">Sieć</a></li>
</ul>
</li>
<li>
<a href="/development/">Rozwój</a>
<i class="icon-arrow-down switch"></i><ul class="submenu">
<li><a class="dropdown-item" href="/compilations/">Kompilacje</a></li>
<li><a class="dropdown-item" href="/technology/">Technologia</a></li>
<li><a class="dropdown-item" href="/virtualization/">Wirtualizacja</a></li>
<li><a class="dropdown-item" href="/databases/">Bazy danych</a></li>
<li><a class="dropdown-item" href="/marketing/">Marketing</a></li>
</ul>
</li>
<li>
<a href="/professionals/">Profesjonaliści</a>
</li>
</ul>
</nav>
</div>
<!-- section main content -->
<section class="main-content mt-3">
<div class="container-xl">

<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Główny</a></li>
<li class="breadcrumb-item"><a href="/development/">Rozwój</a></li>
</ol>
</nav>

<div class="row gy-4">

<div class="col-lg-8">
<!-- post single -->
<div class="post post-single">
<!-- post header -->
<div class="post-header">
<h1 class="title mt-0 mb-3">Budowanie dokumentów XML za pomocą PHP</h1>
</div>
<!-- featured image -->
<div class="featured-image">

<figure class="image" itemscope itemtype="https://schema.org/ImageObject">
<img src="https://cdn.smartworldclub.net/3493677/construyendo_documentos_xml_con_php.jpg.webp" loading="lazy" alt="Budowanie dokumentów XML za pomocą PHP | Rozwój 2026" title="Budowanie dokumentów XML za pomocą PHP | Rozwój 2026" itemprop="image url" />
<figcaption itemprop="name">Budowanie dokumentów XML za pomocą PHP | Rozwój 2026</figcaption>
</figure>
</div>
<!-- post content -->
<div class="post-content clearfix">
<div><strong>Spisie treści</strong> </div>
Zanim zagłębimy się w techniczną część tworzenia tych dokumentów, musimy najpierw zrozumieć, czym jest plik. <strong>XML</strong>, oraz jakie są jego rzeczywiste i aktualne zastosowania, w ten sposób będziemy mogli znacznie bardziej docenić wiedzę, którą możemy zdobyć w tym dziale.<br />Co to jest plik XML?Z pewnością wielu z Was już wie, że to plik <strong>XML</strong>Jednak dla tych, którzy go nie znają lub widzą ten termin po raz pierwszy, wyjaśnimy nieco jego koncepcję. <em>XML</em> to język znaczników i tagów bardzo podobny do <strong>HTML</strong> co pozwala nam uporządkować treść w dokumencie. Składa się z etykiet i jednostek, a podczas generowania musimy przestrzegać kilku zasad.<br />Na pewno pomyślisz, że opisuję <em>HTML</em> także i dlaczego nie używamy tego ostatniego zamiast tworzyć nowy język, ponieważ po prostu dlatego, że <strong>XML</strong> jest bardziej rygorystyczny i bardziej konfigurowalny, dlatego jest znacznie bardziej elastyczny w użyciu i łatwiejszy do zrozumienia. Etykiety na <em>HTML</em> są już zdefiniowane w twoim standardzie, zamiast tego <em>XML</em> etykiety tworzone są przez nas zgodnie z zasadami języka.<br />Na początku samouczka wspomnieliśmy o jednej z najbardziej znanych aplikacji <strong>XML</strong> i jest to zorganizowanie treści tak, aby mogła być wykorzystywana przez aplikacje, jest to w zasadzie wymagane. Organizując dokument <em>XML</em> możemy zrobić to, co nazywa się a <strong>analizować,</strong> co jest niczym innym jak odczytaniem pliku i jeśli będzie on zgodny ze standardem, będziemy mogli poznać jego strukturę i tym samym przetworzyć wspomnianą zawartość w naszym programie.<br />W prawdziwym kontekście <em>XML</em> może być używany do przesyłania danych przez <strong>Serwis internetowy</strong> lub przywrócić i zaimportować dane w <em>Baza danych</em>. Jak widać, jest to format przenośności, czyli przenoszenia danych z jednej platformy na drugą. Działa również w ramach tej samej platformy, na przykład plik konfiguracyjny, w którym każda etykieta odpowiada parametrom odczytywanym przez naszą aplikację w celu wygenerowania odpowiedniego zachowania.<br />Chociaż w ciągu ostatnich kilku lat format <strong>JSON</strong> zyskał dużą popularność w środowiskach internetowych i prawdopodobnie zyskał popularność w ciągu roku <em>XML</em>, w rzeczywistości tak nie jest, bo każdy ma swoją przestrzeń, zaleta <em>JSON</em> jest to, że jest natywny w <em>JavaScript</em> a dzięki nowym sposobom pracy z tym językiem konwersja jest praktycznie niepotrzebna.<br />Jednak w innych środowiskach, takich jak aplikacje desktopowe, języki serwera inne niż <em>JavaScript</em> i aplikacje, które są na rynku od dłuższego czasu, <strong>XML</strong> jest to ważna i szeroko stosowana opcja.<br />Jak zawsze wszystko zależy od naszych potrzeb, możemy powiedzieć, że ani <em>JSON</em> żaden <em>XML</em> są złe, każdy po prostu ma swój zakres i cel, więc jeśli chcemy użyć <strong>XML</strong> a ktoś nam mówi, że jesteśmy przestarzali, po prostu wiedz, że dla naszych potrzeb jest to całkowicie aktualne.<br />Jak już wyjaśniliśmy plik <strong>XML</strong> Składa się z tagów, jednak aby była poprawnie zinterpretowana, musi mieć nagłówek, a następnie zaczynać się od treści. Nagłówek jest znany jako <strong>DTD</strong> lub <strong>Definicja typu dokumentu</strong>, co można przetłumaczyć jako definicję typu dokumentu, a następnie treść jest <strong>schemat</strong> lub schemat w języku hiszpańskim.<br />Co robi DTD?ten <strong>DTD</strong> jest tym, który przekaże informacje do <strong>parser</strong> o jakim rodzaju <em>XML</em> jest i wewnątrz <strong>schemat</strong> To tam trafi treść, którą stworzyliśmy dla naszego dokumentu.<br />Na poniższym obrazku zobaczymy, jak wygląda dokument testowy, który mamy w naszym środowisku tworzenia aplikacji:<br />
<p><img src="https://cdn.smartworldclub.net/3493677/construyendo_documentos_xml_con_php_2.jpg.webp"></p>

Zauważyliśmy, że <strong>XML</strong> to nic innego jak tekst, dzięki czemu możemy wykonywać proste procedury w naszej aplikacji w <em>PHP</em> wygenerować zawartość odpowiadającą plikowi <em>XML</em>, jednak jeśli widzimy nagłówek pliku <em>XML</em> ma takie same znaczniki jak znaczniki otwierające języka, to znaczy <strong><?</strong> więc jeśli zrobimy <strong>wyrzucił</strong> prosta treść <em>XML</em> otrzymamy błąd składni.<br />Możemy to łatwo poprawić za pomocą <em>nagłówek</em> i zmiana <strong>Typ MIME</strong> przez tekst / xml to sprawi, że interpreter <strong>PHP</strong> nie uważaj już nagłówka naszej treści za błąd <em>XML</em> które generujemy. Zobaczmy poniżej kod, którego użyjemy do stworzenia naszego małego przykładu:<br />
<pre translate="no"> &quot;Fight Club&quot;, 'autor' =&gt; &quot;Chuck Palahniuk&quot;), array ('title' =&gt; &quot;World War Z&quot;, 'autor' =&gt; &quot;Max Brooks&quot;,)); foreach ($ książki jako $ książka) {echo &quot;\ n&quot;; echo &quot;{$ książka ['tytuł']} \ n&quot;; echo &quot;{$ książka ['autor']} \ n&quot;; echo &quot;\ n \ n&quot;; }?&gt; zm13 -&gt; </pre><br />Widzimy tutaj, jak pierwszą rzeczą, którą robimy, jest wygenerowanie nagłówka dokumentu za pomocą <em>nagłówek</em>, to pozwoli nam umieścić tag początkowy naszego <strong>XML</strong> bez podnoszenia błędów składniowych w <em>PHP</em>, a następnie umieszczamy poza kodem nasz główny tag <strong>schemat</strong>, w tym przypadku biblioteka.<br />Następnie tworzymy małą tablicę z kilkoma elementami, które nazwaliśmy książkami, ważną rzeczą tutaj, mimo że jest to coś ręcznego, jest to, że widzimy, że możemy to zrobić z wynikiem <em>Baza danych</em> na przykład. Na koniec przeglądamy naszą tablicę i drukujemy, zawsze szanując etykiety, aby nasze <strong>XML</strong> jest dobrze uformowany.<br />W końcu, gdy uruchomimy to na naszym serwerze testowym, w przeglądarce otrzymamy coś takiego:<br />
<p><img src="https://cdn.smartworldclub.net/3493677/construyendo_documentos_xml_con_php_3.jpg.webp">POWIĘKSZAĆ</p>

Poprawa przetwarzaniaChociaż powyższe działa całkiem dobrze i jest bardzo przydatne, jest zbyt podatne na błędy, dlatego do naszej pomocy mamy kilka bibliotek, które pozwalają nam tworzyć dokumenty <em>XML</em> z najczęstszych definicji języka, do tego mamy bibliotekę <strong>SŁOŃCE</strong> i księgarni <strong>SimpleXML</strong>, oba pozwalają nam generować dokumenty <em>XML</em> jak również robienie <em>analizować</em> tego.<br />W poniższym przykładzie zamierzamy wziąć plik <strong>XML</strong> czyli w naszym katalogu, dla ułatwienia możemy zapisać dokument, który został wygenerowany w poprzednim przykładzie i nazwiemy go <strong>php_crear_xml.xml, </strong>biorąc pod uwagę, że po zmodyfikowaniu rozszerzenia nie będziemy już mogli używać PHP do drukowania nagłówka, łatwy sposób na zobaczenie <em>XML</em> pełna jest do wciśnięcia <strong>CTRL + u</strong> i będziemy mieli to samo. Gdy już mamy nasz plik testowy, użyjemy następującego kodu, aby wykonać <strong>analizować</strong> z pliku.<br />
<pre translate="no">załaduj („przykład1.xml”); proces ($ parser-&gt; documentElement); function process ($ node) {foreach ($ node-&gt; childNodes as $ child) {if ($ child-&gt; nodeType == XML_TEXT_NODE) ​​​​{echo &quot;
<p>&quot;. $ child-&gt; nodeValue.&quot;</p>
&quot;;} else if ($ child-&gt; nodeType == XML_ELEMENT_NODE) ​​​​{process ($ child);}}}?&gt; var13 -&gt;</pre><br />W kodzie widzimy, że stworzyliśmy obiekt typu <strong>DOMDokument</strong>, to przyniesie nam księgarnię <em>SŁOŃCE</em> aby móc zinterpretować <em>XML</em>, a następnie metodą <strong>Załaduj ()</strong> ładujemy plik <em>XML</em> które mamy w naszej trasie, a następnie wywołujemy funkcję <strong>proces()</strong> to ten, który pozwoli nam przejrzeć załadowany dokument.<br />Na koniec definiujemy naszą funkcję, tutaj przechodzimy przez każdy węzeł, a następnie tworzymy warunek, jeśli jest to element <strong>XML</strong> Wywołujemy funkcję, w przeciwnym razie jeśli jest to tekst to wypisujemy go, dzięki temu możemy uzyskać zawartość <em>XML</em> Nie ma problemu.<br />Jedyną wadą tej metody i tej biblioteki jest ilość pamięci wymaganej na serwerze, więc gdyby był to duży plik <strong>XML </strong>naszemu serwerowi byłoby bardzo trudno je przetworzyć.<br />
<p><img src="https://cdn.smartworldclub.net/3493677/construyendo_documentos_xml_con_php_4.jpg.webp"></p>

Mamy też bibliotekę <strong>SimpleXML</strong> aby móc tworzyć i przetwarzać pliki <em>XML</em>, jego użycie jest podobne do biblioteki <strong>SŁOŃCE</strong>Jest jednak bardziej ograniczony pod względem zastosowania i bardziej złożony, chociaż jest nieco większy, więc nasz kod może być bardziej złożony.<br />Ciekawą rzeczą w tej bibliotece jest to, że obiekt jest tworzony za pomocą naszego <strong>XML</strong> dzięki którym możemy bezpośrednio uzyskać dostęp do ich właściwości, a tym samym z nimi pracować. Zobaczmy w poniższym kodzie, jak możemy uzyskać dostęp do etykiet <strong>kwalifikacja</strong> każdej książki, którą mamy w naszym <em>XML</em> testów.<br />
<pre translate="no">książka jako $ książka) {echo $ książka-&gt; tytuł. &quot;<br />&quot;;}?&gt; zm13 -&gt;</pre><br />Chociaż kod może wyglądać na nieco krótki, to co robimy, to tworzymy obiekt z załadowanego pliku i możemy zapętlić z <em>dla każdego</em> każdy z jego węzłów, a tym samym dostęp do zawartości jego etykiety w prosty sposób. Za pomocą którego otrzymalibyśmy w przeglądarce:<br />
<p><img src="https://cdn.smartworldclub.net/3493677/construyendo_documentos_xml_con_php_5.jpg.webp"></p>
Na tym kończymy ten samouczek, pomyślnie utworzyliśmy plik <strong>XML</strong> i nauczyliśmy się dwóch różnych sposobów odczytywania tych plików, ważne jest, aby ćwiczyć z bardziej złożonymi plikami, abyśmy byli gotowi i mogli zastosować naszą wiedzę w rzeczywistej aplikacji.Podobał Ci się i pomógł ten samouczek?Możesz nagrodzić autora, naciskając ten przycisk, aby dać mu pozytywny punkt</div>
<!-- post bottom section -->
<div class="post-bottom">
<div class="row d-flex align-items-center">
<div class="col-md-6 col-12 text-center text-md-start">
</div>

<div class="col-md-6 col-12">

</div>

</div>
</div>

</div>

<div class="spacer" data-height="50" style="height: 50px;"></div>

<!-- section header -->
<div class="section-header">
<center><img src="https://smartworldclub.net/template/css/svg/wave.svg" class="wave" alt="wave"> <img src="https://smartworldclub.net/template/css/svg/wave.svg" class="wave" alt="wave"> <img src="https://smartworldclub.net/template/css/svg/wave.svg" class="wave" alt="wave"> <img src="https://smartworldclub.net/template/css/svg/wave.svg" class="wave" alt="wave"> <img src="https://smartworldclub.net/template/css/svg/wave.svg" class="wave" alt="wave"></center>
</div>

</div>

<div class="col-lg-4">

<!-- sidebar -->
<div class="sidebar"><div class="inner-wrapper-sticky">

<!-- widget popular posts -->
<div class="widget rounded">
<div class="widget-header text-center">
<h3 class="widget-title">Popularne Wiadomości</h3>
<img src="https://smartworldclub.net/template/css/svg/wave.svg" class="wave" alt="wave" />
</div>
<div class="widget-content">
<div class="post post-list-sm circle">
<div class="thumb circle">
<span class="number">1</span>
<a href="/11697539-create-user-profiles-in-chrome"><div class="inner"><img src="https://cdn.smartworldclub.net/4433345/crear_perfiles_de_usuario_en_chrome.jpg.webp" alt="post-title"></div></a>
</div>
<div class="details clearfix">
<h6 class="post-title my-0"><a href="/11697539-create-user-profiles-in-chrome">Twórz profile użytkowników w Chrome</a></h6>
</div>
</div>

<div class="post post-list-sm circle">
<div class="thumb circle">
<span class="number">2</span>
<a href="/11698069-manual-to-clear-cache-in-windows-10-mac-and-linux"><div class="inner"><img src="https://cdn.smartworldclub.net/3161465/_borrar_cache_windows10_mac_y_linux.png.webp" alt="post-title"></div></a>
</div>
<div class="details clearfix">
<h6 class="post-title my-0"><a href="/11698069-manual-to-clear-cache-in-windows-10-mac-and-linux">▷ WYCZYŚĆ PAMIĘĆ PODRĘCZNĄ Windows 10 ✔️ Mac i Linux</a></h6>
</div>
</div>

<div class="post post-list-sm circle">
<div class="thumb circle">
<span class="number">3</span>
<a href="/11703180-activate-all-windows-10-processor-cores"><div class="inner"><img src="https://cdn.smartworldclub.net/3360449/_activar_todos_los_ncleos_del_procesador_windows_10.png.webp" alt="post-title"></div></a>
</div>
<div class="details clearfix">
<h6 class="post-title my-0"><a href="/11703180-activate-all-windows-10-processor-cores">▷ Aktywuj wszystkie rdzenie procesora Windows 10</a></h6>
</div>
</div>

<div class="post post-list-sm circle">
<div class="thumb circle">
<span class="number">4</span>
<a href="/11696004-seo-keyword-list"><div class="inner"><img src="https://cdn.smartworldclub.net/5236937/seo_-_lista_de_palabras_clave.jpg.webp" alt="post-title"></div></a>
</div>
<div class="details clearfix">
<h6 class="post-title my-0"><a href="/11696004-seo-keyword-list">SEO - lista słów kluczowych</a></h6>
</div>
</div>

<div class="post post-list-sm circle">
<div class="thumb circle">
<span class="number">5</span>
<a href="/11696688-networks-the-osi-model"><div class="inner"><img src="https://cdn.smartworldclub.net/8208075/redes_el_modelo_osi.jpg.webp" alt="post-title"></div></a>
</div>
<div class="details clearfix">
<h6 class="post-title my-0"><a href="/11696688-networks-the-osi-model">Sieci - model OSI</a></h6>
</div>
</div>
</div>
</div>

<!-- widget categories -->
<div class="widget rounded">
<div class="widget-header text-center">
<h3 class="widget-title">Zalecane</h3>
<img src="https://smartworldclub.net/template/css/svg/wave.svg" class="wave" alt="wave" />
</div>
<div class="widget-content">
<ul class="list">
<li><a href="/11700881-how-to-enable-or-disable-location-samsung-galaxy-a82021-2022">Jak włączyć lub wyłączyć lokalizację Samsung Galaxy A82021-2022</a></li><li><a href="/11700882-how-to-disable-or-enable-and-configure-dhcp-router-etb-zte-zxhn">Jak wyłączyć lub włączyć i skonfigurować router DHCP ETB ZTE ZXHN</a></li><li><a href="/11700883-how-to-create-bootable-usb-installation-macos-mojave">Jak utworzyć rozruchową instalację USB macOS Mojave?</a></li><li><a href="/11700884-how-to-download-mp3-from-youtube-linux-videos-with-commands">Jak pobierać MP3 z filmów z YouTube Linux za pomocą poleceń</a></li><li><a href="/11700885-enable-or-disable-gps-location-on-iphone-xs-or-iphone-xs-max">Włącz lub wyłącz lokalizację GPS na iPhonie Xs lub iPhonie Xs Max</a></li><li><a href="/11700886-how-to-remove-or-change-sim-pin-iphone-xs-or-iphone-xs-max">Jak usunąć lub zmienić PIN karty SIM iPhone Xs lub iPhone Xs Max</a></li>
</ul>
</div>

</div>

<div class="widget no-container rounded text-md-center">
<span class="ads-title">- Sponsored Ad -</span>
</div>

<!-- widget post carousel -->
<div class="widget rounded">
<div class="widget-header text-center">
<h3 class="widget-title">Wybór Redakcji</h3>
<img src="https://smartworldclub.net/template/css/svg/wave.svg" class="wave" alt="wave" />
</div>
<div class="widget-content">
<div>
<div aria-live="polite" class="slick-list draggable">
<div class="slick-track" role="listbox">

<div data-slick-index="-1" id="" aria-hidden="true" tabindex="-1" style="width: 294px;">
<div class="thumb rounded">
<a href="/microsoft/1" class="category-badge position-absolute" tabindex="-1">Microsoft</a>
<a href="/11699033-fix-windows-featured-content-error-on-lock-screen" tabindex="-1"><div class="inner"><img src="https://cdn.smartworldclub.net/2774267/solucin_error_contenido_destacado_de_windows_en_pantalla_bloqueo.png.webp" alt="Napraw błąd „Polecane treści systemu Windows” na ekranie blokady"></div></a>
</div>
<h5 class="post-title mb-0 mt-4"><a href="/11699033-fix-windows-featured-content-error-on-lock-screen" tabindex="-1" style="color: #000; font-size: 18px;">Napraw błąd „Polecane treści systemu Windows” na ekranie blokady</a></h5><div class="thumb rounded">
<a href="/linux-unix/1" class="category-badge position-absolute" tabindex="-1">Linux / Unix</a>
<a href="/11699034-how-to-create-and-configure-ssh-tunnel-in-linux" tabindex="-1"><div class="inner"><img src="https://cdn.smartworldclub.net/8732154/cmo_crear_y_configurar_tnel_ssh_en_linux.png.webp" alt="Jak stworzyć i skonfigurować tunel SSH w Linuksie"></div></a>
</div>
<h5 class="post-title mb-0 mt-4"><a href="/11699034-how-to-create-and-configure-ssh-tunnel-in-linux" tabindex="-1" style="color: #000; font-size: 18px;">Jak stworzyć i skonfigurować tunel SSH w Linuksie</a></h5><div class="thumb rounded">
<a href="/microsoft/1" class="category-badge position-absolute" tabindex="-1">Microsoft</a>
<a href="/11699035-how-to-change-font-size-windows-10" tabindex="-1"><div class="inner"><img src="https://cdn.smartworldclub.net/8101513/cmo_cambiar_tamao_de_fuente_windows_10.png.webp" alt="Jak zmienić rozmiar czcionki Windows 10"></div></a>
</div>
<h5 class="post-title mb-0 mt-4"><a href="/11699035-how-to-change-font-size-windows-10" tabindex="-1" style="color: #000; font-size: 18px;">Jak zmienić rozmiar czcionki Windows 10</a></h5><div class="thumb rounded">
<a href="/linux-unix/1" class="category-badge position-absolute" tabindex="-1">Linux / Unix</a>
<a href="/11699036-how-to-install-zabbix-on-ubuntu-17" tabindex="-1"><div class="inner"><img src="https://cdn.smartworldclub.net/8732265/cmo_instalar_zabbix_en_ubuntu_17.png.webp" alt="Jak zainstalować Zabbix na Ubuntu 17"></div></a>
</div>
<h5 class="post-title mb-0 mt-4"><a href="/11699036-how-to-install-zabbix-on-ubuntu-17" tabindex="-1" style="color: #000; font-size: 18px;">Jak zainstalować Zabbix na Ubuntu 17</a></h5>
</div>
</div>
</div>

</div>
</div>
</div>

<div class="widget no-container rounded text-md-center">
<span class="ads-title">- Sponsored Ad -</span>
</div>

</div>
</div>

</div>
</div>

</div>
</section>

<!-- footer -->
<footer>
<div class="container-xl">
<div class="footer-inner">
<div class="row d-flex align-items-center gy-4">
<!-- copyright text -->
<div class="col-md-4">
<span class="copyright"> Copyright By SmartWorldClub.net <? echo date("Y") ?>. All Rights Reserved.</span>
</div>

<!-- social icons -->
<div class="col-md-4 text-center">
<!-- lang icons -->
Ta strona w innych językach:<br>
<div style="text-align:center;padding-bottom:30px;">
<a href="https://smartworldclub.net/11697083-building-xml-documents-with-php" class="flags pt" hreflang="pt"></a>
<a href="https://bg.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags bg" hreflang="bg"></a>
<a href="https://cs.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags cs" hreflang="cs"></a>
<a href="https://da.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags da" hreflang="da"></a>
<a href="https://de.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags de" hreflang="de"></a>
<a href="https://fr.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags fr" hreflang="fr"></a>
<a href="https://hr.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags hr" hreflang="hr"></a>
<a href="https://it.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags it" hreflang="it"></a>
<a href="https://lt.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags lt" hreflang="lt"></a>
<a href="https://lv.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags lv" hreflang="lv"></a>
<a href="https://nl.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags nl" hreflang="nl"></a>
<a href="https://no.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags no" hreflang="no"></a>
<a href="https://pl.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags pl" hreflang="pl"></a>
<a href="https://ro.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags ro" hreflang="ro"></a>
<a href="https://sr.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags sr" hreflang="sr"></a>
<a href="https://sv.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags sv" hreflang="sv"></a>
<a href="https://tr.smartworldclub.net/11697083-building-xml-documents-with-php" class="flags tr" hreflang="tr"></a>
</div>
</div>

<!-- go to top button -->
<div class="col-md-4">
<a href="#" id="return-to-top" class="float-md-end"><i class="icon-arrow-up"></i>Back to Top</a>
</div>
</div>
</div>
</div>
</footer>
</div>

<script>(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://cdn.jsdelivr.net/npm/yandex-metrica-watch/tag.js", "ym"); ym(83852878, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script>
<!-- STYLES -->
<link rel="stylesheet" href="https://smartworldclub.net/template/css/bootstrap.min.css" media="all">
<link rel="stylesheet" href="https://smartworldclub.net/template/css/all.min.css" media="all">
<link rel="stylesheet" href="https://smartworldclub.net/template/css/slick.css" media="all">
<link rel="stylesheet" href="https://smartworldclub.net/template/css/simple-line-icons.css" media="all">
<link rel="stylesheet" href="https://smartworldclub.net/template/css/style.css" media="all">
<link rel="stylesheet" href="https://smartworldclub.net/template/css/flags.css" media="all">
<!-- JAVA SCRIPTS -->
<script src="https://smartworldclub.net/template/js/jquery.min.js"></script>
<script src="https://smartworldclub.net/template/js/popper.min.js"></script>
<script src="https://smartworldclub.net/template/js/bootstrap.min.js"></script>
<script src="https://smartworldclub.net/template/js/slick.min.js"></script>
<script src="https://smartworldclub.net/template/js/jquery.sticky-sidebar.min.js"></script>
<script src="https://smartworldclub.net/template/js/custom.js"></script>
</body>
</html>
