XML 문서는 "루트"에서 시작하여 "리프"로 확장되는 트리 구조를 형성합니다.


XML 문서 인스턴스

XML 문서는 간단하고 자기 설명적인 구문을 사용합니다.

<?xml 버전 ="1.0" 인코딩="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>알림</heading>
<body>이번 주말에 저를 잊지 마세요!</body>
</note>

첫 번째 줄은 XML 선언. 이는 XML 버전(1.0)과 사용된 인코딩(ISO-8859-1 = 라틴-1/서유럽 문자 집합)을 정의합니다.

다음 줄은 문서의 루트 요소 를 설명합니다(예: "이 문서는 메모입니다").

<note>

다음 4줄은 루트(to, from, 표제 및 본문)의 4개 하위 요소 를 설명합니다.

<to>Tove< /to>
<from>Jani</from>
<heading>알림</heading>
<body>이번 주말에도 저를 잊지 마세요!</body>

마지막 줄은 루트 요소의 끝을 정의합니다.

</note>

이 예에서 다음과 같이 가정할 수 있습니다. XML 문서에는 Tove에 대한 Jani Note가 포함되어 있습니다.

XML은 매우 자기 설명적입니다. 그렇지 않나요?


XML 문서는 트리 구조를 형성합니다

XML 문서에는 루트 요소가 포함되어야 합니다. 이 요소는 다른 모든 요소의 상위 요소입니다.

XML 문서의 요소는 문서 트리를 형성합니다. 트리는 루트에서 시작하여 트리의 맨 아래까지 확장됩니다.

모든 요소는 하위 요소를 가질 수 있습니다:

<root>
<child>
subchild>
</child>

부모, 자식, 형제라는 용어는 요소 간의 관계를 설명하는 데 사용됩니다. 상위 요소는 하위 요소를 소유합니다. 동일한 수준의 하위 요소는 형제(형제 또는 자매)가 됩니다.

모든 요소는 텍스트 콘텐츠와 속성을 가질 수 있습니다(HTML과 유사).


예:

nodetree.gif

위 이미지는 다음 XML의 책을 나타냅니다.

<bookstore>
<도서 카테고리="COOKING">
​ <title lang="ko">일상 이탈리아어</title>
​ <author>Giada De Laurentiis</author>
​ <연도>2005
​ <가격>30.00</price>
</책>
<도서 카테고리="어린이">
​ <title lang="ko">해리포터</title>
​ <author>J K. Rowling</author>
​ <연도>2005
​ <가격>29.99</price>
</책>
<도서 카테고리="WEB">
​ <title lang="ko">XML 학습</title>
​ <저자>Erik T. Ray</저자>
​ <연도>2003
​ <가격>39.95</price>
</book>
</bookstore>

인스턴스의 루트 요소는 <bookstore>입니다. 문서의 모든 <book> 요소는 <bookstore> 내에 포함됩니다.

요소에는 , <author>, <year>, <price> 등 4개의 하위 요소가 있습니다. </p><p><br/></p><p><br/></p></div></div> <div class="Dic_coderun_hide"> <div> <div class="Dic_coderun_hide_top"> <span></span> <a href="javascript:;" class="Dic_coderun_close"><img src="/static/imghw/Dic_coderun_close.png" alt="" /></a> </div> <div class="Dic_coderun_hide_bottom"> <div class="Dic_coderun_hide_bottomL"> <div class="Dic_coderun_hide_bottomLM"> <div id="codeEditor"></div> </div> <div class="Dic_coderun_hide_bottomL_button"> <a href="javascript:;" id="J_Commit">제출하다</a> </div> </div> <div class="Dic_coderun_hide_bottomR" id="viewPort-content"></div> </div> </div> </div> <script> $(function() { $(document).on("click", ".Dic_coderun_button", function(e) { e.preventDefault(); e.stopPropagation(); $(".Dic_coderun_hide").addClass("active"); $("body").css("overflow", "hidden"); }); $(document).on("click", ".Dic_coderun_close", function(e) { e.preventDefault(); e.stopPropagation(); $(".Dic_coderun_hide").removeClass("active"); $("body").css("overflow", ""); }); $(document).on("click", function(e) { var wrapper = $(".Dic_coderun_hide"); var inner = $(".Dic_coderun_hide > div"); if (wrapper.hasClass("active")) { if (!inner.is(e.target) && inner.has(e.target).length === 0) { wrapper.removeClass("active"); } } }); $(document).on("click", ".Dic_coderun_hide > div", function(e) { e.stopPropagation(); }); }); </script> </div> <div class="manualDM12"> <div> <a href="//m.sbmmt.com/global/ko/xml/xml-usage.html" class="manualDM12L"> <img src="/static/imghw/manualDM12L.png" alt="" /> <img src="/static/imghw/manualDM12L_hover.png" alt="" class="manualDM12_hover" /> <span>XML 사용법</span> </a> </div> <div> <a href="//m.sbmmt.com/global/ko/xml/xml-syntax.html" class="manualDM12R"> <span>XML 구문</span> <img src="/static/imghw/manualDM12R.png" alt="" /> <img src="/static/imghw/manualDM12R_hover.png" alt="" class="manualDM12_hover" /> </a> </div> </div> <div class="manualDM3"> <h3 class="studycata_top"><span>관련 동영상</span></h3> <div class="studylistmain2M"> <div class="studylistmain2Ms"> <span>무료</span> <a href="//m.sbmmt.com/global/ko/course/812.html"><img src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/course/000/000/041/620debc3eab3f377.jpg" alt="최신 ThinkPHP 5.1 세계 최초 비디오 튜토리얼(PHP 전문가 온라인 교육 과정이 되기까지 60일)" /></a> <div> <a href="//m.sbmmt.com/global/ko/course/812.html"><span class="level2">중급</span>최신 ThinkPHP 5.1 세계 최초 비디오 튜토리얼(PHP 전문가 온라인 교육 과정이 되기까지 60일)</a> <div> <div class="icon_f"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-yanjing-"></use> </svg> <span>496581</span> </div> <a href="javascript:;" class="courseICollection" data-id="812"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star1.png" alt="수집" /> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star2.png" alt="수집" /> </a> </div> </div> </div> <div class="studylistmain2Ms"> <span>무료</span> <a href="//m.sbmmt.com/global/ko/course/1503.html"><img src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/course/000/000/067/64be3549bab29833.png" alt="PHP로 사업을 시작하는 방법에 대해 간단히 이야기해 보겠습니다." /></a> <div> <a href="//m.sbmmt.com/global/ko/course/1503.html"><span class="level1">초등학교</span>PHP로 사업을 시작하는 방법에 대해 간단히 이야기해 보겠습니다.</a> <div> <div class="icon_f"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-yanjing-"></use> </svg> <span>18930</span> </div> <a href="javascript:;" class="courseICollection" data-id="1503"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star1.png" alt="수집" /> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star2.png" alt="수집" /> </a> </div> </div> </div> <div class="studylistmain2Ms"> <span>무료</span> <a href="//m.sbmmt.com/global/ko/course/836.html"><img src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/course/000/000/001/5d24230536122573.jpg" alt="민망한 물건 백과사전 사이트를 모방한 Mini 버전 MVC 프레임워크의 대규모 실용 Tianlongbabu 개발" /></a> <div> <a href="//m.sbmmt.com/global/ko/course/836.html"><span class="level2">중급</span>민망한 물건 백과사전 사이트를 모방한 Mini 버전 MVC 프레임워크의 대규모 실용 Tianlongbabu 개발</a> <div> <div class="icon_f"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-yanjing-"></use> </svg> <span>45442</span> </div> <a href="javascript:;" class="courseICollection" data-id="836"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star1.png" alt="수집" /> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star2.png" alt="수집" /> </a> </div> </div> </div> <div class="studylistmain2Ms"> <span>무료</span> <a href="//m.sbmmt.com/global/ko/course/901.html"><img src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/course/000/000/067/64be28a53a4f6310.png" alt="웹 프론트 엔드 개발에 대한 빠른 소개" /></a> <div> <a href="//m.sbmmt.com/global/ko/course/901.html"><span class="level1">초등학교</span>웹 프론트 엔드 개발에 대한 빠른 소개</a> <div> <div class="icon_f"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-yanjing-"></use> </svg> <span>157178</span> </div> <a href="javascript:;" class="courseICollection" data-id="901"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star1.png" alt="수집" /> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star2.png" alt="수집" /> </a> </div> </div> </div> <div class="studylistmain2Ms"> <span>무료</span> <a href="//m.sbmmt.com/global/ko/course/866.html"><img src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/course/000/001/120/5a9918df773bf364.jpeg" alt="로그인 인증 및 클래식 게시판" /></a> <div> <a href="//m.sbmmt.com/global/ko/course/866.html"><span class="level1">초등학교</span>로그인 인증 및 클래식 게시판</a> <div> <div class="icon_f"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-yanjing-"></use> </svg> <span>31115</span> </div> <a href="javascript:;" class="courseICollection" data-id="866"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star1.png" alt="수집" /> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star2.png" alt="수집" /> </a> </div> </div> </div> <div class="studylistmain2Ms"> <span>무료</span> <a href="//m.sbmmt.com/global/ko/course/902.html"><img src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/course/000/000/035/5d27fb58823dc974.jpg" alt="PHP 실용 개발 시작하기: 빠른 PHP 생성 [중소기업 포럼]" /></a> <div> <a href="//m.sbmmt.com/global/ko/course/902.html"><span class="level2">중급</span>PHP 실용 개발 시작하기: 빠른 PHP 생성 [중소기업 포럼]</a> <div> <div class="icon_f"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-yanjing-"></use> </svg> <span>81557</span> </div> <a href="javascript:;" class="courseICollection" data-id="902"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star1.png" alt="수집" /> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/index2_star2.png" alt="수집" /> </a> </div> </div> </div> </div> </div> </div> </div> <div class="manualMainR"> <div class="phpRs popularAItools"> <div class="phpRs_top"> <img src="/static/imghw/phpRs_popularAItools.png" alt="" /> <span>핫 AI 도구</span> </div> <div class="phpRsM"> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/ai/undress-ai-tool"><img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /></a> <div> <a href="//m.sbmmt.com/global/ko/ai/undress-ai-tool">Undress AI Tool</a> <p>무료로 이미지를 벗다</p> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/ai/ai-clothes-remover"><img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /></a> <div> <a href="//m.sbmmt.com/global/ko/ai/ai-clothes-remover">AI Clothes Remover</a> <p>사진에서 옷을 제거하는 온라인 AI 도구입니다.</p> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/ai/undresserai-undress"><img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /></a> <div> <a href="//m.sbmmt.com/global/ko/ai/undresserai-undress">Undresser.AI Undress</a> <p>사실적인 누드 사진을 만들기 위한 AI 기반 앱</p> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/ai/artgpt"><img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173397491055212.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="ArtGPT" /></a> <div> <a href="//m.sbmmt.com/global/ko/ai/artgpt">ArtGPT</a> <p></p> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/ai/stock-market-gpt"><img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173418760225266.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Stock Market GPT" /></a> <div> <a href="//m.sbmmt.com/global/ko/ai/stock-market-gpt">Stock Market GPT</a> <p>더 현명한 결정을 위한 AI 기반 투자 연구</p> </div> </div> </div> <div class="phpRs_more"> <a href="//m.sbmmt.com/global/ko/ai">더보기</a> </div> </div> <div class="phpRs hotArticle"> <div class="phpRs_top"> <img src="/static/imghw/phpRs_hotArticle.png" alt="" /> <span>인기 기사</span> </div> <div class="phpRsM"> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/1797041752.html">마틴게일 전략이 효과적인가요? Ouyi DCA 로봇 매개변수 설정에 대한 자세한 설명</a> <span>1 몇 주 전     By DDD</span> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/1797039691.html">암호화폐를 다른 사람에게 상속하는 방법은 무엇입니까? 바이낸스 거래소 계좌 자산 이체 솔루션</a> <span>2 몇 주 전     By DDD</span> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/1797031860.html">PHP의 JSON 개체에서 동일한 이름(예: 'id')을 가진 모든 키의 값을 일괄 추출하는 방법</a> <span>1 몇 달 전     By DDD</span> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/1797032253.html">Linux에 CMake를 설치하는 방법 - 기술을 더 쉽게 만드세요</a> <span>1 몇 달 전     By Jack chen</span> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/1797031865.html">PHP gRPC 클라이언트 JWT 인증 실습 가이드</a> <span>1 몇 달 전     By DDD</span> </div> </div> <div class="phpRs_more"> <a href="//m.sbmmt.com/global/ko/article.html">더보기</a> </div> </div> <div class="phpRs hotTopics"> <div class="phpRs_top"> <img src="/static/imghw/phpRs_hotTopics.png" alt="" /> <span>뜨거운 주제</span> </div> <div class="phpRsM"> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/dydjjmb"># Douyin 수준 가격표 1-75</a> <div> <div> <img src="/static/imghw/phpRsMs_hotTopics1.png" alt="" /> <span>20536</span> </div> <div> <img src="/static/imghw/phpRsMs_hotTopics2.png" alt="" /> <span>7</span> </div> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/wifixswipfp"># Wi-Fi에 할당된 IP가 없다고 표시됨</a> <div> <div> <img src="/static/imghw/phpRsMs_hotTopics1.png" alt="" /> <span>13641</span> </div> <div> <img src="/static/imghw/phpRsMs_hotTopics2.png" alt="" /> <span>4</span> </div> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/xnisjhjsyzm"># 인증번호를 받을 수 있는 가상 휴대폰 번호</a> <div> <div> <img src="/static/imghw/phpRsMs_hotTopics1.png" alt="" /> <span>11976</span> </div> <div> <img src="/static/imghw/phpRsMs_hotTopics2.png" alt="" /> <span>4</span> </div> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/gmailyxdlrkzn"># Gmail 이메일의 로그인 입구는 어디에 있나요?</a> <div> <div> <img src="/static/imghw/phpRsMs_hotTopics1.png" alt="" /> <span>9050</span> </div> <div> <img src="/static/imghw/phpRsMs_hotTopics2.png" alt="" /> <span>17</span> </div> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/faq/windowsaqzx"># Windows 보안 센터를 끄는 방법</a> <div> <div> <img src="/static/imghw/phpRsMs_hotTopics1.png" alt="" /> <span>8519</span> </div> <div> <img src="/static/imghw/phpRsMs_hotTopics2.png" alt="" /> <span>7</span> </div> </div> </div> </div> <div class="phpRs_more"> <a href="//m.sbmmt.com/global/ko/faq/zt">더보기</a> </div> </div> <div class="phpRs hotTools"> <div class="phpRs_top"> <img src="/static/imghw/phpRs_hotTools.png" alt="" /> <span>인기 있는 도구</span> </div> <div class="phpRsM"> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/92" title="메모장++7.3.1"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="메모장++7.3.1" /></a> <div> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/92" title="메모장++7.3.1">메모장++7.3.1</a> <p>사용하기 쉬운 무료 코드 편집기</p> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/93" title="SublimeText3 중국어 버전"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 중국어 버전" /></a> <div> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/93" title="SublimeText3 중국어 버전">SublimeText3 중국어 버전</a> <p>중국어 버전, 사용하기 매우 쉽습니다.</p> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/121" title="스튜디오 13.0.1 보내기"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="스튜디오 13.0.1 보내기" /></a> <div> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/121" title="스튜디오 13.0.1 보내기">스튜디오 13.0.1 보내기</a> <p>강력한 PHP 통합 개발 환경</p> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/469" title="드림위버 CS6"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="드림위버 CS6" /></a> <div> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/469" title="드림위버 CS6">드림위버 CS6</a> <p>시각적 웹 개발 도구</p> </div> </div> <div class="phpRsMs"> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/500" title="SublimeText3 Mac 버전"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac 버전" /></a> <div> <a href="//m.sbmmt.com/global/ko/toolset/development-tools/500" title="SublimeText3 Mac 버전">SublimeText3 Mac 버전</a> <p>신 수준의 코드 편집 소프트웨어(SublimeText3)</p> </div> </div> </div> <div class="phpRs_more"> <a href="//m.sbmmt.com/global/ko/ai">더보기</a> </div> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img class="lazy" src="/static/imghw/logo.png" alt=""> <p>공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!</p> </div> <div class="footermid"> <a href="//m.sbmmt.com/global/ko/about/us.html">회사 소개</a> <a href="//m.sbmmt.com/global/ko/about/disclaimer.html">부인 성명</a> <a href="//m.sbmmt.com/global/ko/new/">최근 업데이트</a> <a href="//m.sbmmt.com/global/ko/new/">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <!-- Matomo --> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <!-- End Matomo Code --> <script> var editor = null; layui.use(function() { var util = layui.util; util.fixbar({ on: { mouseenter: function(type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function(type) { layer.closeAll("tips"); }, }, }); }); $('.codebtn').on('click', function(e) { e.preventDefault(); e.stopPropagation(); $('.Dic_coderun_hide').addClass("active"); $("body").css("overflow", "hidden"); var code = $(this).closest(".example").find(".example_code pre").html(); code = code.replace(/</g, "<"); code = code.replace(/>/g, ">"); code = code.replace(/ /g, " "); if (editor == null) { editor = ace.edit("codeEditor"); editor.setTheme("ace/theme/vibrant_ink"); editor.getSession().setUseWrapMode(true); editor.getSession().setMode("ace/mode/php"); editor.setShowPrintMargin(false); editor.getSession().setValue(code) } else { editor.getSession().setValue(code) } $("#J_Commit").trigger("click"); return false }) var ifr; var initresultbox = function() { ifr = document.createElement("iframe"); ifr.setAttribute("frameborder", "0"); ifr.setAttribute("id", "iframeResult"); document.getElementById("viewPort-content").innerHTML = ""; document.getElementById("viewPort-content").appendChild(ifr); $("#iframeResult").css({ "width": "100%", "height": "99%" }) }; $("#J_Commit").click(function() { tmp_code = editor.getSession().getValue(); if (tmp_code.indexOf("\<\?php") >= 0 && tmp_code.indexOf("?>") < 0) { tmp_code += "?>" } if (tmp_code.indexOf("<form") >= 0) { tmp_code += '<script src="/static/js/run.bat.js"><\/script>' } runcode = 3; initresultbox(); var ifrw = (ifr.contentWindow) ? ifr.contentWindow : (ifr.contentDocument.document) ? ifr.contentDocument.document : ifr.contentDocument; if ((tmp_code.indexOf("imagedestroy") >= 0 || tmp_code.indexOf("imagecopyresampled") >= 0 || tmp_code.indexOf("imagecreatetruecolor") >= 0 || tmp_code.indexOf("imagecreatefrom") >= 0) && tmp_code.indexOf("header") >= 0) { tmp_code = tmp_code.replace(/header\(/g, "//header("); tmp_code = "data:image/jpg;base64,IiArIHRtcF9jb2RlOw0KCQkJCXRtcF9jb2RlICs9ICI="; $.post("https://work.php.cn/compile.php", { code: tmp_code, language: runcode }, function(data) { ifrw.document.open(); ifrw.document.write('<h2>代码执行效果预览</h2><img src="data:image/' + data.split("data:image/")[1] + '">'); ifrw.document.close() }) } else { $.post("https://work.php.cn/compile.php", { code: tmp_code, language: runcode }, function(data) { ifrw.document.open(); ifrw.document.write(data); ifrw.document.close() }) } }); document.getElementById("copyLink").addEventListener("click", function(event) { event.preventDefault(); var copyText = this.getAttribute("data-copy"); copyText = window.location.href; var tempInput = document.createElement("input"); tempInput.value = copyText; document.body.appendChild(tempInput); tempInput.select(); document.execCommand("copy"); document.body.removeChild(tempInput); layer.msg("✅ SUCCESS: " + copyText); }); document.getElementById("lan1sp").addEventListener("click", function(event) { event.preventDefault(); var elements = document.getElementsByClassName("m_menu"); for (var i = 0; i < elements.length; i++) { elements[i].style.display = "block"; } }); document.getElementById("m_editormain12main_topi_sp").addEventListener("click", function(event) { event.preventDefault(); var elements = document.getElementsByClassName("m_menu"); for (var i = 0; i < elements.length; i++) { elements[i].style.display = "none"; } }); document.getElementById("lan1").addEventListener("click", function(event) { event.preventDefault(); var elements = document.getElementsByClassName("m_menu_lang"); for (var i = 0; i < elements.length; i++) { elements[i].style.display = "block"; } }); document.getElementById("m_editormain12main_topi_lan").addEventListener("click", function(event) { event.preventDefault(); var elements = document.getElementsByClassName("m_menu_lang"); for (var i = 0; i < elements.length; i++) { elements[i].style.display = "none"; } }); $(function () { var $win = $(window); var $lnav = $(".Lnav"); var $footer = $(".footer"); if ($lnav.length === 0) return; if ($footer.length === 0) return; function handleScroll() { var scrollTop = $win.scrollTop(); var winHeight = $win.height(); var footerTop = $footer.offset().top; var fixedBottomPos = scrollTop + winHeight; if (fixedBottomPos >= footerTop) { $lnav.css("height", "calc(100vh - 350px)"); } else { $lnav.css("height", "auto"); } } handleScroll(); $win.on("scroll", handleScroll); }); </script> </body> </html> <script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9ec0b37f4edc4d21',t:'MTc3NjE0ODYzOA=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" integrity="sha512-8DS7rgIrAmghBFwoOTujcf6D9rXvH8xm8JQ1Ja01h9QX8EzXldiszufYa4IFfKdLUKTTrnSFXLDkUEOTrZQ8Qg==" data-cf-beacon='{"version":"2024.11.0","token":"8c758bee214b4fe0858e454e5edf6f97","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}' crossorigin="anonymous"></script>