php解析cas返回的xml解决思路

php中文网
发布: 2016-06-13 11:49:58
原创
1960人浏览过

php解析cas返回的xml
    使用php进行cas验证时,对方返回这么一段xml

<br /><cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'><br />    <cas:authenticationSuccess><br />        <cas:user>zhangjian</cas:user><br />        <cas:language></cas:language><br />    </cas:authenticationSuccess><br /></cas:serviceResponse><br />
登录后复制


    于是使用php相关函数进行解析

$str = <<

/*
$validateXML = simplexml_load_string($str);print_r($validateXML);
$successnode = $validateXML->authenticationSuccess[0];
var_dump($successnode);
*/

$xml = new DOMDocument();
$xml -> loadXML($str);
var_dump($xml);
登录后复制


    结果都解析不出来,哪位朋友遇到过请指点下,不甚感激!!!
------解决方案--------------------
SimpleXML也是PHP5后提供的一套简单易用的xml工具集,
不过它不适用于包含namespace(命名空间)的xml。
------解决方案--------------------
怎么会?
<br /><?php<br />$str = <<<EOT&lt;br /&gt;&lt;cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'&gt;&lt;br /&gt;    &lt;cas:authenticationSuccess&gt;&lt;br /&gt;        &lt;cas:user&gt;zhangjian&lt;/cas:user&gt;&lt;br /&gt;        &lt;cas:language&gt;&lt;/cas:language&gt;&lt;br /&gt;    &lt;/cas:authenticationSuccess&gt;&lt;br /&gt;&lt;/cas:serviceResponse&gt;&lt;br /&gt;EOT;<br /> <br /> <br /><br />$validateXML = simplexml_load_string($str, null, 0, 'cas', true);<br />print_r($validateXML);<br /><br />$successnode = $validateXML->authenticationSuccess[0];<br />print_r($successnode);<br /><br /> <br />$xml = new DOMDocument();<br />$xml -> loadXML($str);<br />print_r($xml);</pre><div class="contentsignin">登录后复制</div></div></p>
<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush: text">SimpleXMLElement Object&lt;br&gt;(&lt;br&gt;    [authenticationSuccess] =&amp;gt; SimpleXMLElement Object&lt;br&gt;        (&lt;br&gt;            [user] =&amp;gt; zhangjian&lt;br&gt;            [language] =&amp;gt; SimpleXMLElement Object&lt;br&gt;                (&lt;br&gt;                )&lt;br&gt;&lt;br&gt;        )&lt;br&gt;&lt;br&gt;)&lt;br&gt;SimpleXMLElement Object&lt;br&gt;(&lt;br&gt;    [user] =&amp;gt; zhangjian&lt;br&gt;    [language] =&amp;gt; SimpleXMLElement Object&lt;br&gt;        (&lt;br&gt;        )&lt;br&gt;&lt;br&gt;)&lt;br&gt;DOMDocument Object&lt;br&gt;(&lt;br&gt;    [doctype] =&amp;gt; &lt;br&gt;    [implementation] =&amp;gt; (object value omitted)&lt;br&gt;    [documentElement] =&amp;gt; (object value omitted)&lt;br&gt;    [actualEncoding] =&amp;gt; &lt;br&gt;    [encoding] =&amp;gt; &lt;br&gt;    [xmlEncoding] =&amp;gt; &lt;br&gt;    [standalone] =&amp;gt; 1&lt;br&gt;    [xmlStandalone] =&amp;gt; 1&lt;br&gt;    [version] =&amp;gt; 1.0&lt;br&gt;    [xmlVersion] =&amp;gt; 1.0&lt;br&gt;    [strictErrorChecking] =&amp;gt; 1&lt;br&gt;    [documentURI] =&amp;gt; file:///D:/AMP/web/&lt;br&gt;    [config] =&amp;gt; &lt;br&gt;    [formatOutput] =&amp;gt; &lt;br&gt;    [validateOnParse] =&amp;gt; &lt;br&gt;    [resolveExternals] =&amp;gt; &lt;br&gt;    [preserveWhiteSpace] =&amp;gt; 1&lt;br&gt;    [recover] =&amp;gt; &lt;br&gt;    [substituteEntities] =&amp;gt; &lt;br&gt;    [nodeName] =&amp;gt; #document&lt;br&gt;    [nodeValue] =&amp;gt; &lt;br&gt;    [nodeType] =&amp;gt; 9&lt;br&gt;    [parentNode] =&amp;gt; &lt;br&gt;    [childNodes] =&amp;gt; (object value omitted)&lt;br&gt;    [firstChild] =&amp;gt; (object value omitted)&lt;br&gt;    [lastChild] =&amp;gt; (object value omitted)&lt;br&gt;    [previousSibling] =&amp;gt; &lt;br&gt;    [attributes] =&amp;gt; &lt;br&gt;    [ownerDocument] =&amp;gt; &lt;br&gt;    [namespaceURI] =&amp;gt; &lt;br&gt;    [prefix] =&amp;gt; &lt;br&gt;    [localName] =&amp;gt; &lt;br&gt;    [baseURI] =&amp;gt; file:///D:/AMP/web/&lt;br&gt;    [textContent] =&amp;gt; &lt;br&gt;    &lt;br&gt;        zhangjian&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;</pre><div class="contentsignin">登录后复制</div></div>                <div class="everysee">
                    <h2>大家都在看:</h2>
                    <div>
                                        <a href="/faq/613132.html" title="在PHP中的readlink()函数">在PHP中的readlink()函数</a>
                                        <a href="/faq/612767.html" title="我们如何编写PHP脚本来释放与MySQL结果关联的游标内存?">我们如何编写PHP脚本来释放与MySQL结果关联的游标内存?</a>
                                        <a href="/faq/610346.html" title="PHP intdiv() 函数">PHP intdiv() 函数</a>
                                        <a href="/faq/610335.html" title="我们如何使用PHP脚本删除MySQL数据库?">我们如何使用PHP脚本删除MySQL数据库?</a>
                                        <a href="/faq/609974.html" title="PHP中的zip_entry_name()函数">PHP中的zip_entry_name()函数</a>
                                        </div>
                </div>
                          
                </div>
                            </div>
                
            <!-- <div class="ask_line-container" >
                <div class="ask_line"></div>
                <button type="button" class="ask_text test-iframe-handle">
                没有解决问题?点击使用智能助手
                </button>
                <div class="ask_line"></div>
            </div> -->
                            <div class="community flexRow newcommunity">
                    <div class="comleft flexRow newcomlimg">
                        <a class="newcomlimga" target="_blank" rel="nofollow" href="https://pan.quark.cn/s/f79bda81fa1b" title="PHP速学教程(入门到精通)" >
                            <img src="https://img.php.cn/upload/Recdownload/000/000/085/666bdff371e4d231.png" class="comlimg newcomlimg" alt="PHP速学教程(入门到精通)">
                        </a>
                        <div class="comldiv flexColumn newcomldiv">
                            <a class="comldup newcomldup" target="_blank" rel="nofollow" title="PHP速学教程(入门到精通)" href="https://pan.quark.cn/s/f79bda81fa1b">PHP速学教程(入门到精通)</a>
                            <p class="comlddown newcomlddown">PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!</p>
                        </div>
                    </div>
                    <a class="comright flexRow newcomright" target="_blank" rel="nofollow" href="https://pan.quark.cn/s/f79bda81fa1b" title="PHP速学教程(入门到精通)">
                        下载
                    </a>
                </div>
                
          
			
            <div  class="wzconlabels">
                
                                <div style="display: inline-flex;float: right; color:#333333;">来源:php中文网</div>
                            </div>


            <div class="wzconFx">
                <a class="wzcf-sc articleICollection " data-id="199105">
                                            <img src="/static/lhimages/shoucang_2x.png">
                        <span>收藏</span>
                                    </a>

                <a  class="wzcf-dz articlegoodICollection " data-id="199105">
                                            <img src="/static/images/images/icon37.png">
                        <span>点赞</span>
                                    </a>
            </div>



            <div class="wzconOtherwz">
                                    <a href="/faq/199104.html">
                        <span>上一篇:PHP 显示有关问题</span>
                    </a>
                                    <a href="/faq/199107.html">
                        <span>下一篇:在调试一个上传文件并保存在数据库里的小程序,始终出现有关问题,向这里的大神请问</span>
                    </a>
                            </div>
            <div class="wzconShengming">
                <img src="/static/images/images/benzhanshengming.png" />
                <div>本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn</div>
            </div>

                       <!-- PC-文章底部 -->
                        <div class="wzconZzwz">
                <div class="wzconZzwztitle">最新问题</div>
                <div class="wdsyContent">
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1799131.html"  target="_blank" title="php运行环境搭建好了怎么上传源码_传php源码到环境步骤" class="wdcdcTitle">php运行环境搭建好了怎么上传源码_传php源码到环境步骤</a>
                            <a href="/faq/1799131.html" class="wdcdcCons">首先确认Web服务器根目录路径,如Apache的/var/www/html或Nginx配置中的root路径,并确保有写入权限;接着可通过SCP命令上传源码至服务器,例如使用scp-r/path/to/local/php-sourceusername@server-ip:/path/to/web/root并输入密码完成传输,随后登录服务器检查文件完整性;也可采用SFTP图形化工具如FileZilla,配置服务器IP、端口22、用户名及密码后,通过拖拽方式将本地PHP源码上传至Web根目录;若源码托</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 20:11:02</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">677</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1799098.html"  target="_blank" title="怎么配SublimeJ Go环境_GOPATH+模块兼容指南" class="wdcdcTitle">怎么配SublimeJ Go环境_GOPATH+模块兼容指南</a>
                            <a href="/faq/1799098.html" class="wdcdcCons">首先正确设置GOPATH环境变量并创建必要子目录,然后在项目根目录执行gomodinit启用Go模块,接着通过PackageControl安装SublimeJGo插件并配置gopath与go_bin路径,最后处理GOPATH与模块共存时的路径冲突,确保使用模块优先并禁用use_gopath_only选项。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 20:01:02</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">762</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1797390.html"  target="_blank" title="JavaScript实时比较与验证两个输入字段的值" class="wdcdcTitle">JavaScript实时比较与验证两个输入字段的值</a>
                            <a href="/faq/1797390.html" class="wdcdcCons">本文旨在指导开发者如何使用JavaScript实现两个输入字段的实时值比较与验证。我们将探讨常见的错误、推荐的事件处理机制(如事件委托和keyup事件),以及如何正确地获取并比较输入框的值,从而提供即时用户反馈,提升表单交互体验。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 13:47:19</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">797</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1797389.html"  target="_blank" title="如何为WordPress子目录重置Content-Security-Policy" class="wdcdcTitle">如何为WordPress子目录重置Content-Security-Policy</a>
                            <a href="/faq/1797389.html" class="wdcdcCons">当网站根目录通过.htaccess设置Content-Security-Policy(CSP)时,该策略会默认继承到所有子目录,可能导致WordPress在子目录安装时后台功能异常。本教程将指导您如何在WordPress的/wp-admin/目录下通过特定的.htaccess配置,取消继承的CSP头部,从而恢复WordPress管理界面的正常运行,而无需全局放松网站的安全策略。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 13:47:02</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">538</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1797384.html"  target="_blank" title="使用 Docker 容器化 Laravel 和 PostgreSQL 应用" class="wdcdcTitle">使用 Docker 容器化 Laravel 和 PostgreSQL 应用</a>
                            <a href="/faq/1797384.html" class="wdcdcCons">本教程详细介绍了如何利用Docker和DockerCompose容器化Laravel应用程序与PostgreSQL数据库。我们将提供优化的Dockerfile和docker-compose.yml配置,涵盖PHP-FPM、Composer、Node.js依赖安装以及PostgreSQL数据库的设置,确保开发环境的快速搭建和一致性。文章还包括运行指令、数据库连接配置及重要的生产环境考量,旨在帮助开发者高效地管理Laravel项目的容器化部署。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 13:46:02</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">388</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1797375.html"  target="_blank" title="PHP SFTP多服务器文件快速上传教程" class="wdcdcTitle">PHP SFTP多服务器文件快速上传教程</a>
                            <a href="/faq/1797375.html" class="wdcdcCons">本教程旨在详细指导如何利用PHP的ssh2扩展实现向多个SFTP服务器快速上传文件。文章将涵盖ssh2扩展的安装、SSH连接与认证、SFTP子系统的初始化,以及通过SFTP流或ssh2_scp_send函数进行文件上传的具体实现。此外,还将探讨如何构建高效的上传逻辑以应对多文件和多服务器场景,并提供重要的注意事项,包括错误处理、安全性及性能优化,确保上传过程的稳定与高效。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 13:44:24</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">680</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1797363.html"  target="_blank" title="解决Python向PHP返回多JSON字符串的正确姿势" class="wdcdcTitle">解决Python向PHP返回多JSON字符串的正确姿势</a>
                            <a href="/faq/1797363.html" class="wdcdcCons">本教程旨在解决Python脚本向PHP应用传输多个JSON对象时遇到的常见问题。文章详细介绍了如何优化Python脚本,将所有JSON数据聚合为一个完整的JSON数组并输出。随后,它演示了PHP端如何正确解析这一嵌套结构,通过两次json_decode操作,先将整体JSON字符串解码为PHP数组,再逐个解码内部的JSON字符串为关联数组,从而实现Python与PHP之间高效且结构化的数据交换。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 13:42:06</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">816</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1797356.html"  target="_blank" title="Laravel 8 数组输入验证:@error 指令的正确用法与错误消息显示" class="wdcdcTitle">Laravel 8 数组输入验证:@error 指令的正确用法与错误消息显示</a>
                            <a href="/faq/1797356.html" class="wdcdcCons">本教程详细阐述了在Laravel8中处理数组类型输入(如name="field[key]")时的表单验证及错误消息显示机制。重点讲解了@errorBlade指令如何正确匹配数组字段的验证错误,确保is-invalid类正确应用并显示对应的错误信息,以避免常见的验证反馈失效问题。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 13:41:16</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">759</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1797351.html"  target="_blank" title="Symfony中集成GraphQL与前端模板:通过AJAX实现数据交互" class="wdcdcTitle">Symfony中集成GraphQL与前端模板:通过AJAX实现数据交互</a>
                            <a href="/faq/1797351.html" class="wdcdcCons">本教程旨在指导如何在Symfony应用中集成GraphQL,并利用OverblogGraphQLBundle配置专属API端点。我们将探讨如何通过AJAX从前端(如Twig模板)向此端点发送GraphQL查询,实现数据的高效交互,其模式与传统RESTAPI的消费方式类似,从而连接后端GraphQL服务与前端用户界面。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 13:40:31</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">448</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="/faq/1797321.html"  target="_blank" title="PHP 动态 SQL WHERE 子句构建:避免重复 AND 的策略" class="wdcdcTitle">PHP 动态 SQL WHERE 子句构建:避免重复 AND 的策略</a>
                            <a href="/faq/1797321.html" class="wdcdcCons">本文探讨了在PHP中动态构建SQL查询WHERE子句时常见的“WHEREAND”语法错误及其解决方案。通过逐步构建条件字符串,确保第一个条件不带AND,后续条件正确使用AND连接,从而生成符合SQL规范的查询语句,提高代码的健壮性和可读性。</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan">2025-11-30 13:35:11</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <a class="wdcdcirwatch flexRow"><img src="/static/images/images/icon43.png"  class="wdcdcirwatchi">131</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="wdsyConLine wdsyConLine2"></div>
                                    </div>
            </div>
            <div class="wzconZt" >
                <div class="wzczt-title">
                    <div>相关专题</div>
                    <a href="/faq/zt" target="_blank">更多>
                    </a>
                </div>
                <div class="wzcttlist">
                    <ul>
                                                <li class="ul-li">
                            <a target="_blank" href="/faq/javaglq"><img onerror="this.onerror=''; this.src='/static/images/default1.png'" src="https://img.php.cn/upload/subject/202511/30/2025113012484960945.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" /> </a>
                            <a target="_blank" href="/faq/javaglq" class="title-a-spanl"><span>java过滤器</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="/faq/javaxunj"><img onerror="this.onerror=''; this.src='/static/images/default1.png'" src="https://img.php.cn/upload/subject/202511/30/2025113012464331831.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" /> </a>
                            <a target="_blank" href="/faq/javaxunj" class="title-a-spanl"><span>java虚拟机</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="/faq/javabmm"><img onerror="this.onerror=''; this.src='/static/images/default1.png'" src="https://img.php.cn/upload/subject/202511/30/2025113012441572778.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" /> </a>
                            <a target="_blank" href="/faq/javabmm" class="title-a-spanl"><span>java 包命名</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="/faq/javazyhzmys"><img onerror="this.onerror=''; this.src='/static/images/default1.png'" src="https://img.php.cn/upload/subject/202511/30/2025113012413363432.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" /> </a>
                            <a target="_blank" href="/faq/javazyhzmys" class="title-a-spanl"><span>java 异或运算</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="/faq/eclipseyxxm"><img onerror="this.onerror=''; this.src='/static/images/default1.png'" src="https://img.php.cn/upload/subject/202511/30/2025113012304422871.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" /> </a>
                            <a target="_blank" href="/faq/eclipseyxxm" class="title-a-spanl"><span>eclipse 运行项目</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="/faq/jspdzxgc"><img onerror="this.onerror=''; this.src='/static/images/default1.png'" src="https://img.php.cn/upload/subject/202511/30/2025113012273776170.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" /> </a>
                            <a target="_blank" href="/faq/jspdzxgc" class="title-a-spanl"><span>jsp的执行过程</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="/faq/javasrscyj"><img onerror="this.onerror=''; this.src='/static/images/default1.png'" src="https://img.php.cn/upload/subject/202511/30/2025113012242474646.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" /> </a>
                            <a target="_blank" href="/faq/javasrscyj" class="title-a-spanl"><span>java输入输出语句</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="/faq/javaczhy"><img onerror="this.onerror=''; this.src='/static/images/default1.png'" src="https://img.php.cn/upload/subject/202511/30/2025113012222267462.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" /> </a>
                            <a target="_blank" href="/faq/javaczhy" class="title-a-spanl"><span>Java重载含义</span> </a>
                        </li>
                                            </ul>
                </div>
            </div>
<div class="wzcongg"><script type="text/javascript" src="https://teacher.php.cn/php/NzIzNmE5NjBlOTgwNWZlNTMzN2E0MGEzNmU3NjM3NmI6Og==" ></script></div>
        </div>
    </div>
    <div class="phpwzright">
            <div class="wzrOne" style="margin-bottom:31px; padding:0px; width: 366px;">
        <script type="text/javascript" src="https://teacher.php.cn/php/N2Q0ODk3NTAwZTFmODQ1NGM4Y2VjYzQzZTVkOTI5NDk6Og==" ></script>
        <!-- <script type="text/javascript" smua="d=p&s=b&u=u2839468&w=366&h=270" src="https://www.nkscdn.com/smu/o.js"></script> -->
        </div>
		        <div class="wzrOne">
            <div class="wzroTitle">热门推荐</div>
            <div class="wzroList">
                <ul>
                                        
                            <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" href="/faq/815124.html">php空格字符如何表示</a>
                                </div>
                            </li>
                                        
                            <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" href="/faq/773412.html">php中nbsp是什么意思</a>
                                </div>
                            </li>
                                        
                            <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" href="/faq/613516.html">如何从PHP中调用Python文件?</a>
                                </div>
                            </li>
                                        
                            <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" href="/faq/613300.html">我们如何使用使用mysql_fetch_assoc()函数的PHP脚本来显示MySQL表中的所有记录?</a>
                                </div>
                            </li>
                                        
                            <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" href="/faq/613204.html">ini_set()在PHP中的作用是什么?</a>
                                </div>
                            </li>
                                        <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;"  target="_blank" rel="nofollow" href="https://pan.quark.cn/s/f79bda81fa1b" title="PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!"><b>PHP速学教程(入门到精通)</b></a>
                                </div>
                            </li>
                    
                </ul>
            </div>
            
        </div>
        <div class="wzrTwo">
                    </div>
		<div class="wzrTwo">
                <div style="position: relative;"><a class="" href="https://teacher.php.cn/jump/67" title="开源免费商场系统" rel="nofollow" target="_blank"><img style="width: 100%; " src="https://img.php.cn/teacher/course/20220930/8ef7a4a308a22ece023e77e5428c0e25.png" alt="开源免费商场系统"></a><span style="position: absolute;right: 5px;border: 1px solid #333;padding: 2px;color: #333;line-height: 14px;font-size: 12px;bottom: 5px;">广告</span></div>
        		
		</div>
        <div class="wzrThree">
            <div class="wzrthree-title">
                <div>热门教程</div>
                <a target="_blank" href="https://www.php.cn/k.html">更多>
                </a>
            </div>
            <div class="wzrthreelist">
                <div class="wzrthreeTab">
                    <div class="check tabdiv" data-id="one">相关推荐 <div></div></div>
                    <div class="tabdiv" data-id="two">热门推荐<div></div></div>
                    <div class="tabdiv" data-id="three">最新课程<div></div></div>
                </div>
                <ul class="one">
                <script type="text/javascript" src="https://teacher.php.cn/php/MTJjOWU0YjVmMmE1MzI1OTgyNzRlYmJmYjE0MmZkNWY6Og==" ></script>
                                                <li>
                                <a target="_blank" href="/course/1672.html" title="AngularJS教程" class="wzrthreelaimg">
                                    <img src="https://img.php.cn/upload/course/000/000/090/68998d18b4142615.png" alt="AngularJS教程"/>
                                </a>
                                <div class="wzrthree-right">
                                    <a target="_blank" href="/course/1672.html">AngularJS教程</a>
                                    <div class="wzrthreerb">
                                        <div >14536次学习</div>
                                                                                    <a class="courseICollection" data-id="1672"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                            </div>
                                </div>
                            </li>
                                                        <li>
                                <a target="_blank" href="/course/263.html" title="CSS3实现按钮特效视频教程" class="wzrthreelaimg">
                                    <img src="https://img.php.cn/upload/course/000/000/068/625e6d9844265291.jpg" alt="CSS3实现按钮特效视频教程"/>
                                </a>
                                <div class="wzrthree-right">
                                    <a target="_blank" href="/course/263.html">CSS3实现按钮特效视频教程</a>
                                    <div class="wzrthreerb">
                                        <div >31216次学习</div>
                                                                                    <a class="courseICollection" data-id="263"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                            </div>
                                </div>
                            </li>
                                                        <li>
                                <a target="_blank" href="/course/1212.html" title="细说PHP第三季" class="wzrthreelaimg">
                                    <img src="https://img.php.cn/upload/course/000/000/068/6256919e7ec6d334.png" alt="细说PHP第三季"/>
                                </a>
                                <div class="wzrthree-right">
                                    <a target="_blank" href="/course/1212.html">细说PHP第三季</a>
                                    <div class="wzrthreerb">
                                        <div >109289次学习</div>
                                                                                    <a class="courseICollection" data-id="1212"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                            </div>
                                </div>
                            </li>
                                            </ul>
                <ul class="two" style="display: none;">
                                            <li>
                            <a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/081/6862652adafef801.png" alt="JavaScript ES5基础线上课程教学"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/1656.html">JavaScript ES5基础线上课程教学</a>
                                <div class="wzrthreerb">
                                    <div >64937次学习</div>
                                                                            <a class="courseICollection" data-id="1656"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="/course/812.html" title="最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/041/620debc3eab3f377.jpg" alt="最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/812.html">最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)</a>
                                <div class="wzrthreerb">
                                    <div >1484960次学习</div>
                                                                            <a class="courseICollection" data-id="812"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="/course/639.html" title="phpStudy极速入门视频教程" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/068/62611ef88fcec821.jpg" alt="phpStudy极速入门视频教程"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/639.html">phpStudy极速入门视频教程</a>
                                <div class="wzrthreerb">
                                    <div >529754次学习</div>
                                                                            <a class="courseICollection" data-id="639"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="/course/379.html" title="独孤九贱(4)_PHP视频教程" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/001/5d1c6dfc9eb09885.jpg" alt="独孤九贱(4)_PHP视频教程"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/379.html">独孤九贱(4)_PHP视频教程</a>
                                <div class="wzrthreerb">
                                    <div >1249519次学习</div>
                                                                            <a class="courseICollection" data-id="379"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="/course/801.html" title="PHP实战天龙八部之仿爱奇艺电影网站" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/001/5d2426f409839992.jpg" alt="PHP实战天龙八部之仿爱奇艺电影网站"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/801.html">PHP实战天龙八部之仿爱奇艺电影网站</a>
                                <div class="wzrthreerb">
                                    <div >769630次学习</div>
                                                                            <a class="courseICollection" data-id="801"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                    </ul>
                <ul class="three" style="display: none;">
                                            <li>
                            <a target="_blank" href="/course/1696.html" title="最新Python教程 从入门到精通" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/081/68c135bb72783194.png" alt="最新Python教程 从入门到精通"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/1696.html">最新Python教程 从入门到精通</a>
                                <div class="wzrthreerb">
                                    <div >2726次学习</div>
                                                                            <a class="courseICollection" data-id="1696"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/081/6862652adafef801.png" alt="JavaScript ES5基础线上课程教学"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/1656.html">JavaScript ES5基础线上课程教学</a>
                                <div class="wzrthreerb">
                                    <div >64937次学习</div>
                                                                            <a class="courseICollection" data-id="1656"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="/course/1655.html" title="PHP新手语法线上课程教学" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/081/684a8c23d811b293.png" alt="PHP新手语法线上课程教学"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/1655.html">PHP新手语法线上课程教学</a>
                                <div class="wzrthreerb">
                                    <div >6428次学习</div>
                                                                            <a class="courseICollection" data-id="1655"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="/course/1654.html" title="支付宝沙箱支付(个人也能用的支付)" class="wzrthreelaimg">
                                <img src="https://img.php.cn/teacher/course/20240819/172406094466c31510e008b.jpg" alt="支付宝沙箱支付(个人也能用的支付)"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/1654.html">支付宝沙箱支付(个人也能用的支付)</a>
                                <div class="wzrthreerb">
                                    <div >4508次学习</div>
                                                                            <a class="courseICollection" data-id="1654"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="/course/1650.html" title="麻省理工大佬Python课程" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/067/66592dcfeb1b4698.png" alt="麻省理工大佬Python课程"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" href="/course/1650.html">麻省理工大佬Python课程</a>
                                <div class="wzrthreerb">
                                    <div >41271次学习</div>
                                                                            <a class="courseICollection" data-id="1650"><img src="/static/images/images/icon-small-nocollect.png" class="nofollow">收藏</a>
                                                                    </div>
                            </div>
                        </li>
                                    </ul>
            </div>
            <script>
                $('.wzrthreeTab>div').click(function(e){
                    $('.wzrthreeTab>div').removeClass('check')
                    $(this).addClass('check')
                    $('.wzrthreelist>ul').css('display','none')
                    $('.'+e.currentTarget.dataset.id).show()
                })
            </script>
        </div>
        <div class="wzrFour">
            <div class="wzrfour-title">
                <div>最新下载</div>
                <a href="/xiazai">更多>
                </a>
            </div>
                        <script>
                $(document).ready(function(){
                    var sjyx_banSwiper = new Swiper(".sjyx_banSwiperwz",{
                        speed:1000,
                        autoplay:{
                            delay:3500,
                            disableOnInteraction: false,
                        },
                        pagination:{
                            el:'.sjyx_banSwiperwz .swiper-pagination',
                            clickable :false,
                        },
                        loop:true
                    });
                    loading();
                    
                })


                function loading(reloading=false){
                    if(reloading){
                        $("#ai_doubao2_3_wait_right").show();
                        $("#ai_doubao2_3_wait_left").show();
                        $("#doubao_error_right").hide();
                        $("#doubao_error_left").hide();
                    }
                    $.ajax({
                        url:'/index.php/api/process?sign=&id=199105&time='+Date.now(),
                        dataType:'json',
                        async:true,
                        headers: {
                            "X-Requested-With": "XMLHttpRequest" // 标记为异步请求
                        },
                        type:'post',
                        success:function(result){
                            if(result.code!=1){
                                $("#doubao_error_right").show();
                                $("#ai_doubao2_3_wait_right").hide();
                                $("#doubao_error_left").show();
                                $("#ai_doubao2_3_wait_left").hide();
                            }else{
                                $("#ai_doubao2_3_wait_right").hide();
                                $("#ai_doubao2_3_wait_left").hide();
                                let doubao_answer = `<p>`+result.data.content+`</p>`;
                                $("#doubao_answer_right").html(doubao_answer);
                                $("#doubao_answer_left").html(doubao_answer);
                                let doubao_titles = '';
                                if(result.data.title){
                                    $.each(result.data.title,function(k,v){
                                        doubao_titles+=`<div class="ai_doubao2_2s"><a rel="nofollow" target="_blank" href="https://doubao.com/chat/new-thread?flow_tracking_source=360_php&channel=360_php_abstract&source=360_db_php_abstract&keywordid=`+"199105"+`&query=参考https://www.php.cn`+"/faq/199105.html的内容,"+encodeURIComponent(v)+`" title="`+v+`"><p><img src="/static/images/doubao_yellowstar.png" alt="">&nbsp;`+v+`</p></a></div>`;
                                    })
                                    
                                }

                                yigeyigezichulai(ai_doubao_titles_show,doubao_titles);
                            }
                        }
                    })
                }

    function ai_doubao_titles_show(str){
        $("#ai_doubao_titles_right").html(str);
        $("#ai_doubao_titles_left").html(str);
    }
    function yigeyigezichulai(callback,str){
        const textElements = document.querySelectorAll('.yigeyigezichulai p');
        textElements.forEach(textElement => {
            const originalHTML = textElement.innerHTML; 
            const tempDiv = document.createElement('div'); 
            tempDiv.innerHTML = originalHTML;

            const fragments = [];
            Array.from(tempDiv.childNodes).forEach(node => {
                if (node.nodeType === Node.TEXT_NODE) {
                    fragments.push(...node.textContent.split(''));
                } else {
                    fragments.push(node.outerHTML);
                }
            });

            textElement.innerHTML = ''; 
            let index = 0;

            const interval = setInterval(() => {
                if (index < fragments.length) {
                    const fragment = fragments[index];
                    
                    
                    if (fragment.startsWith('<')) {
                        textElement.innerHTML += fragment;
                    } else {
                        textElement.innerHTML += fragment;
                    }
                } else {
                    clearInterval(interval);
                    callback(str);
                }
                index++;
            }, 25); // 每 100 毫秒显示一个片段
        });
    }
                

       // 豆包等待动画
       const containers = document.querySelectorAll('.ai_doubao2_3_wait') || [];
          if (containers.length > 0) {
            containers.forEach(container => {
              if (container && container.firstElementChild) {
                const intervalId = setInterval(() => {
                  if (!container || !container.firstElementChild) {
                    clearInterval(intervalId);
                    return;
                  }
                  const firstChild = container.firstElementChild;
                  container.appendChild(firstChild);
                }, 300);
              }
            });
          }
          // AI总结相关功能
          const aiZongjie = document.querySelector('.ai_zongjie');
          const aiDoubao = document.querySelector('.ai_doubao');
          const closeButton = document.querySelector('.ai_doubao1_R_img');
          if (aiZongjie && aiDoubao && closeButton) {
            aiZongjie.addEventListener('click', () => {
              aiDoubao.style.display = 'block';
            });
            closeButton.addEventListener('click', () => {
              aiDoubao.style.display = 'none';
            });
          }
          // 文字动画效果
          const textElements = document.querySelectorAll('.ai_doubao2_3s.ai_doubao2_3s_L p') || [];
          if (textElements.length > 0) {
            textElements.forEach(textElement => {
              if (!textElement) return;
              const originalHTML = textElement.innerHTML;
              const tempDiv = document.createElement('div');
              tempDiv.innerHTML = originalHTML;
              const fragments = [];
              Array.from(tempDiv.childNodes).forEach(node => {
                if (!node) return;
                if (node.nodeType === Node.TEXT_NODE) {
                  fragments.push(...(node.textContent || '').split(''));
                } else {
                  fragments.push(node.outerHTML);
                }
              });
              if (fragments.length === 0) return;
              textElement.innerHTML = '';
              let index = 0;
              const interval = setInterval(() => {
                if (!textElement || index >= fragments.length) {
                  clearInterval(interval);
                  return;
                }
                const fragment = fragments[index];
                if (fragment) {
                  textElement.innerHTML += fragment;
                }
                index++;
              }, 100);
            });
          }
          // 页面滚动监听相关
          const divai_zongjie1 = document.getElementById('ai_zongjie1');
          const divai_zongjie2 = document.getElementById('ai_zongjie2');
          const divai_zongjie3 = document.getElementById('ai_zongjie3');
          if (divai_zongjie2) {
            const observer = new IntersectionObserver((entries) => {
              entries.forEach(entry => {
                if (!entry.isIntersecting && divai_zongjie1) {
                  try {
                    divai_zongjie1.style.display = 'flex';
                    requestAnimationFrame(() => {
                      if (divai_zongjie1) {
                        divai_zongjie1.classList.add('visible');
                      }
                    });
                  } catch (e) {
                    console.log('元素操作失败');
                  }
                } else if (divai_zongjie1) {
                  try {
                    divai_zongjie1.classList.remove('visible');
                    divai_zongjie1.addEventListener('transitionend', () => {
                      if (divai_zongjie1 && !divai_zongjie1.classList.contains('visible')) {
                        divai_zongjie1.style.display = 'none';
                      }
                    }, { once: true });
                    if (divai_zongjie3 && divai_zongjie3.style) {
                      divai_zongjie3.style.display = 'none';
                    }
                  } catch (e) {
                    console.log('元素操作失败');
                  }
                }
              });
            }, {
              threshold: 0,
              rootMargin: '-90px 0px 0px 0px'
            });
            try {
              observer.observe(divai_zongjie2);
            } catch (e) {
              console.log('观察器初始化失败');
            }
            // 滚动事件处理
            window.addEventListener('scroll', () => {
              const scrollY = window.scrollY || window.pageYOffset;
              if (divai_zongjie2) {
                try {
                  divai_zongjie2.style.display = scrollY > 1000 ? 'none' : 'block';
                } catch (e) {
                  console.log('滚动处理失败');
                }
              }
            });
          }

            </script>
            <div class="wzrfourList">
                <div class="wzrfourlTab">
                    <div class="check" data-id="onef">网站特效 <div></div></div>
                    <div class="" data-id="twof">网站源码<div></div></div>
                    <div class="" data-id="threef">网站素材<div></div></div>
                    <div class="" data-id="fourf">前端模板<div></div></div>
                </div>
                <ul class="onef">
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="jQuery企业留言表单联系代码" href="/xiazai/js/8071">[表单按钮] jQuery企业留言表单联系代码</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="HTML5 MP3音乐盒播放特效" href="/xiazai/js/8070">[播放器特效] HTML5 MP3音乐盒播放特效</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="HTML5炫酷粒子动画导航菜单特效" href="/xiazai/js/8069">[菜单导航] HTML5炫酷粒子动画导航菜单特效</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="jQuery可视化表单拖拽编辑代码" href="/xiazai/js/8068">[表单按钮] jQuery可视化表单拖拽编辑代码</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="VUE.JS仿酷狗音乐播放器代码" href="/xiazai/js/8067">[播放器特效] VUE.JS仿酷狗音乐播放器代码</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="经典html5推箱子小游戏" href="/xiazai/js/8066">[html5特效] 经典html5推箱子小游戏</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="jQuery滚动添加或减少图片特效" href="/xiazai/js/8065">[图片特效] jQuery滚动添加或减少图片特效</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="CSS3个人相册封面悬停放大特效" href="/xiazai/js/8064">[相册特效] CSS3个人相册封面悬停放大特效</a>
                            </div>
                        </li>
                                    </ul>
                <ul class="twof" style="display:none">
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/10975" title="大气象B2C系统源码" target="_blank">[电商源码] 大气象B2C系统源码</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/10974" title="简单手表销售管理(三层开发)源码" target="_blank">[电商源码] 简单手表销售管理(三层开发)源码</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/10973" title="中易广告联盟商业破解版 免HOST" target="_blank">[电商源码] 中易广告联盟商业破解版 免HOST</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/10972" title="MvMmall 网店系统" target="_blank">[电商源码] MvMmall 网店系统</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/10971" title="秋叶购物商城" target="_blank">[电商源码] 秋叶购物商城</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/10970" title="石大在线财务管理系统" target="_blank">[电商源码] 石大在线财务管理系统</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/10969" title="云商商城系统" target="_blank">[电商源码] 云商商城系统</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/10968" title="LHT蓝海豚团购导航" target="_blank">[电商源码] LHT蓝海豚团购导航</a>
                            </div>
                        </li>
                                    </ul>
                <ul class="threef" style="display:none">
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/sucai/3858"  target="_blank"  title="丰收蔬菜水果市场矢量模板插画">[网站素材] 丰收蔬菜水果市场矢量模板插画</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/sucai/3857"  target="_blank"  title="户外野营露营元素合集矢量素材">[网站素材] 户外野营露营元素合集矢量素材</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/sucai/3856"  target="_blank"  title="比特币宣传方形海报ps素材下载">[网站素材] 比特币宣传方形海报ps素材下载</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/sucai/3855"  target="_blank"  title="秋季丰收合集矢量素材">[网站素材] 秋季丰收合集矢量素材</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/sucai/3854"  target="_blank"  title="蓝莓冰棒雪糕美食海报PSD素材下载">[网站素材] 蓝莓冰棒雪糕美食海报PSD素材下载</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/sucai/3853"  target="_blank"  title="丰收季节秋季元素合集矢量素材">[网站素材] 丰收季节秋季元素合集矢量素材</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/sucai/3852"  target="_blank"  title="购物节主题折扣海报PSD模板设计下载">[网站素材] 购物节主题折扣海报PSD模板设计下载</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/sucai/3851"  target="_blank"  title="购物狂欢人物插图合集矢量素材">[网站素材] 购物狂欢人物插图合集矢量素材</a>
                            </div>
                        </li>
                                    </ul>
                <ul class="fourf" style="display:none">
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/8590"  target="_blank" title="驾照考试驾校HTML5网站模板">[前端模板] 驾照考试驾校HTML5网站模板</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/8589"  target="_blank" title="驾照培训服务机构宣传网站模板">[前端模板] 驾照培训服务机构宣传网站模板</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/8588"  target="_blank" title="HTML5房地产公司宣传网站模板">[前端模板] HTML5房地产公司宣传网站模板</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/8587"  target="_blank" title="新鲜有机肉类宣传网站模板">[前端模板] 新鲜有机肉类宣传网站模板</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/8586"  target="_blank" title="响应式天气预报宣传网站模板">[前端模板] 响应式天气预报宣传网站模板</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/8585"  target="_blank" title="房屋建筑维修公司网站CSS模板">[前端模板] 房屋建筑维修公司网站CSS模板</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/8584"  target="_blank" title="响应式志愿者服务网站模板">[前端模板] 响应式志愿者服务网站模板</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="/xiazai/code/8583"  target="_blank" title="创意T恤打印店网站HTML5模板">[前端模板] 创意T恤打印店网站HTML5模板</a>
                            </div>
                        </li>
                                    </ul>
            </div>
            <script>
                $('.wzrfourlTab>div').click(function(e){
                    $('.wzrfourlTab>div').removeClass('check')
                    $(this).addClass('check')
                    $('.wzrfourList>ul').css('display','none')
                    $('.'+e.currentTarget.dataset.id).show()
                })
            </script>
        </div>
    </div>
</div>
<!--主体 end-->
<!--底部-->
<div class="phpFoot">
    <div class="phpFootIn">
        <div class="phpFootCont">
            <div class="phpFootLeft">
                <dl>
                    <dt>
                        <a href="/about/us.html" rel="nofollow" target="_blank" title="关于我们" class="cBlack">关于我们</a>
                        <a href="/about/disclaimer.html" rel="nofollow" target="_blank" title="免责申明" class="cBlack">免责申明</a>
                        <a href="/about/jbzx.html" rel="nofollow" target="_blank" title="举报中心" class="cBlack">举报中心</a>
                        <a href="javascript:;" rel="nofollow" onclick="advice_data(99999999,'意见反馈')"   title="意见反馈" class="cBlack">意见反馈</a>
                        <a href="https://www.php.cn/teacher.html" rel="nofollow"  target="_blank" title="讲师合作" class="cBlack">讲师合作</a>
                        <a href="https://www.php.cn/blog/detail/20304.html" rel="nofollow" target="_blank" title="广告合作" class="cBlack">广告合作</a>
                        <!--<a href="javascript:;" target="_blank" title="其他合作" class="cBlack">其他合作</a>-->
                        <a href="/new/"   target="_blank" title="最新文章列表" class="cBlack">最新更新</a>
                        <a href="https://global.php.cn/"   target="_blank" title="English" class="cBlack">English</a>
                                                <div class="clear"></div>
                    </dt>
                    <dd class="cont1">php中文网:公益在线php培训,帮助PHP学习者快速成长!</dd>
                    <dd class="cont2">
                      <span class="ylwTopBox">
                        <a href="javascript:;"  class="cBlack"><b class="icon1"></b>关注服务号</a>
                        <em style="display:none;" class="ylwTopSub">
                          <p>微信扫码<br/>关注PHP中文网服务号</p>
                          <img src="/static/images/examples/text16.png"/>
                        </em>
                      </span>
                        <span class="ylwTopBox">
                        <a href="tencent://message/?uin=27220243&Site=www.php.cn&Menu=yes" target="_blank" class="cBlack"><b class="icon2"></b>技术交流群</a>
                        <em style="display:none;" class="ylwTopSub">
                          <p>QQ扫码<br/>加入技术交流群</p>
                          <img src="/static/images/examples/text18.png"/>
                        </em>
                      </span>
                        <div class="clear"></div>
                    </dd>
                </dl>
                
            </div>
            <div class="phpFootRight">
                <div class="phpFootMsg">
                    <span><img src="/static/images/examples/text17.png"/></span>
                    <dl>
                        <dt>PHP中文网订阅号</dt>
                        <dd>每天精选资源文章推送</dd>
                    </dl>
                </div>
                <div class="phpFootMsg">
                    <span><img src="/static/images/examples/text14.png"/></span>
                    <dl>
                        <dt>PHP中文网APP</dt>
                        <dd>随时随地碎片化学习</dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <div class="phpFootCode">
        <div class="phpFootCodeIn"><p>Copyright 2014-2025 <a href="https://www.php.cn/" target="_blank">https://www.php.cn/</a> All Rights Reserved | php.cn | <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">湘ICP备2023035733号</a></p><a href="http://www.beian.gov.cn/portal/index.do" rel="nofollow" target="_blank"><b></b></a></div>
    </div>
</div>
<input type="hidden" id="verifycode" value="/captcha.html">
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c0e685c8743351838d2a7db1c49abd56";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
<script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script>

<span class="layui-hide"><script type="text/javascript" src="https://s4.cnzz.com/z_stat.php?id=1280886301&web_id=1280886301"></script></span>




<!--底部 end-->
<script>
    $(function() {
        //直播倒计时
        $(".liveitem").each(function(){
            timer(this);
        })
        function timer(obj){
            var intDiff = $(obj).data("countdown");
            window.setInterval(function(){
                var day=0,
                    hour=0,
                    minute=0,
                    second=0;//时间默认值
                if(intDiff > 0){
                    day = Math.floor(intDiff / (60 * 60 * 24));
                    hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
                    minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
                    second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
                }else{
                    $(obj).find(".phpZbktBg").remove();
                    return;
                }
                if (hour <= 9) hour = '0' + hour;
                if (minute <= 9) minute = '0' + minute;
                if (second <= 9) second = '0' + second;
                $(obj).find('.day_show').html(day+"");
                $(obj).find('.hour_show').html('<s id="h"></s>'+hour+'');
                $(obj).find('.minute_show').html('<s></s>'+minute+'');
                $(obj).find('.second_show').html('<s></s>'+second+'');
                intDiff--;
            }, 1000);
        }
    });
</script>
<script type="text/javascript" src="/hitsUp?type=article&id=199105&time=1764506764"></script>
<script src="/static/ueditor/third-party/SyntaxHighlighter/shCore.js?1764506764"></script>
<script>article_status = "0";</script>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<!-- <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> -->
<input type="hidden" id="verifycode" value="/captcha.html">
<script src="/static/js/jquery.min.js"></script>
<script src="/static/layui/layui.js"></script>
<script src="/static/js/common_new.js?2.1" ></script>
<script type="text/javascript" src="/static/js/global.min.js?5.5.33"></script>
<script>var _hmt = _hmt || [];(function(){var hm = document.createElement("script");hm.src="//hm.baidu.com/hm.js?c0e685c8743351838d2a7db1c49abd56";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();(function(){var bp = document.createElement('script');var curProtocol = window.location.protocol.split(':')[0];if(curProtocol === 'https'){bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';}else{bp.src = 'http://push.zhanzhang.baidu.com/push.js';};var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(bp, s);})();</script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script>var topadshow = $.cookie('phpcndatatopadshows');if(!topadshow&&1==2){$('.topimages').show();var topobj = $('.topimages').find('.time');var topobj_day = $('.topimages .time').find('.day');var topobj_hours = $('.topimages .time').find('.hours');var topobj_minutes = $('.topimages .time').find('.minutes');var topobj_second = $('.topimages .time').find('.second');var topday = parseInt(topobj_day.html());var tophours = parseInt(topobj_hours.html());var topminutes = parseInt(topobj_minutes.html());var topsecond = parseInt(topobj_second.html());setInterval(function(){if(topsecond > 0){topsecond = topsecond-1;}else{if(topminutes > 0){topminutes = topminutes-1;topsecond = 59;}else{if(tophours > 0){tophours = tophours-1;topminutes = 59;topsecond = 59;}else{if(topday > 0){topday = topday -1;tophours = 23;topminutes = 59;topsecond = 59;}else{topobj.html("<p><span>活动已结束</span></p>");}}}}topobj_second.html(topsecond);topobj_minutes.html(topminutes);topobj_hours.html(tophours);topobj_day.html(topday);},1000);}$('.topimages .layui-icon-close').click(function(){$.cookie('phpcndatatopadshows',1,{expires:7});$('.topimages').hide();});</script>
<link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all'/>
<script type='text/javascript' src='/static/js/viewer.min.js?1'></script>
<script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script>
<style>
        .content img{max-width:100%;}
        .copy-button {
            padding: 5px 10px;
            background-color: #666;
            border: none;
            color: #FFF;
            font-size: 12px;
            cursor: pointer;
            border-radius: 5px;
            position: relative;
            top: 33px;
    right: 5px;
    z-index: 99;
    float: right;
        }
        .copy-button:hover {
            background-color: #fc3930;
        }
    </style>
<script>
    $(document).ready(function(){
        $('#gongzhonghao').hover(function(){
            $('#gzh').show();
        },function(){
            $('#gzh').hide();
        })
    })
</script>
<script>
    layui.use(['jquery','layer'], function(){
        $('.test-iframe-handle').click(function(){
                layer.open({
                type: 2,
                area: ['1300px', '750px'],
                content: 'https://www.php.cn/help/ask?q=php%E8%A7%A3%E6%9E%90cas%E8%BF%94%E5%9B%9E%E7%9A%84xml%E8%A7%A3%E5%86%B3%E6%80%9D%E8%B7%AF',
                fixed: true, // 不固定
                //maxmin: true,
                shadeClose: true,
                title:"智能小助手",
                btnAlign: 'c',
                yes: function(index, layero){
                    // 获取 iframe 的窗口对象
                    var iframeWin =  window[layero.find('iframe')[0]['name']];
                    var elemMark = iframeWin.$('#mark'); // 获得 iframe 中某个输入框元素
                    var value = elemMark.val();
                    if($.trim(value) === '') return elemMark.focus();
                    // 显示获得的值
                    layer.msg('获得 iframe 中的输入框标记值:'+ value);
                }
                });
            })
        var is_login = "0";
        var show = 0;
        var ceng = getCookie('ceng');
        //文章下拉弹出登录
        // if(is_login == 0 && !ceng)
        // {
        //     window.onscroll = function(){
        //         var t = document.documentElement.scrollTop || document.body.scrollTop;
        //         var top_div = document.getElementById( "top_div" );
        //         if( t >= 2500 && show == 0) {
        //             show = 1
        //             setCookie('ceng',1,1);
        //             $(document).trigger("api.loginpopbox");
        //         }
        //     }
        // }
        //未登录复制显示登录按钮
        if(is_login == 0 && false){
            $(".code").hover(function(){
                $(this).find('.contentsignin').show();
            },function(){
                $(this).find('.contentsignin').hide();
            });
            //不给复制
            $('.code').bind("cut copy paste",function(e) {
                e.preventDefault();
            });
            $('.code .contentsignin').click(function(){
                $(document).trigger("api.loginpopbox");
            })
        }else{
            // 获取所有的 <pre> 元素
            var preElements = document.querySelectorAll('pre');
            preElements.forEach(function(preElement) {
                // 创建复制按钮
                var copyButton = document.createElement('button');
                copyButton.className = 'copy-button';
                copyButton.textContent = '复制';
                // 添加点击事件处理程序
                copyButton.addEventListener('click', function() {
                    // 获取当前按钮所属的 <pre> 元素中的文本内容
                    var textContent = preElement.textContent.trim();
                    // 创建一个临时 textarea 元素并设置其值为 <pre> 中的文本内容
                    var tempTextarea = document.createElement('textarea');
                    tempTextarea.value = textContent;
                    // 将临时 textarea 添加到文档中
                    document.body.appendChild(tempTextarea);
                    // 选中临时 textarea 中的文本内容并执行复制操作
                    tempTextarea.select();
                    document.execCommand('copy');
                    // 移除临时 textarea 元素
                    document.body.removeChild(tempTextarea);
                    // 更新按钮文本为 "已复制"
                    this.textContent = '已复制';
                });

                // 创建AI写代码按钮
                var aiButton = document.createElement('button');
                aiButton.className = 'copy-button';
                aiButton.textContent = 'AI写代码';
                aiButton.style.marginLeft = '5px';
                aiButton.style.marginRight = '5px';
                // 添加点击事件处理程序
                aiButton.addEventListener('click', function() {
                // Generate a random number between 0 and 1
                        var randomChance = Math.random();

                    // If the random number is less than 0.5, open the first URL, else open the second
                    if (randomChance < 0.5) {
                        window.open('https://www.doubao.com/chat/coding?channel=php&source=hw_db_php', '_blank');
                    } else {
                        window.open('https://click.aliyun.com/m/1000402709/', '_blank');
                    }
                });

                // 将按钮添加到 <pre> 元素前面
                preElement.parentNode.insertBefore(copyButton, preElement);
                preElement.parentNode.insertBefore(aiButton, preElement);
        });
        }
    })
    function setCookie(name,value,iDay){      //name相当于键,value相当于值,iDay为要设置的过期时间(天)
        var oDate = new Date();
        oDate.setDate(oDate.getDate() + iDay);
        document.cookie = name + '=' + value + ';path=/;domain=.php.cn;expires=' + oDate;
    }
    function getCookie(name) {
        var cookieArr = document.cookie.split(";");
        for(var i = 0; i < cookieArr.length; i++) {
            var cookiePair = cookieArr[i].split("=");
            if(name == cookiePair[0].trim()) {
                return decodeURIComponent(cookiePair[1]);
            }
        }
        return null;
    }

    function aiask(ask){
        layer.open({
            type: 2,
            area: ['1300px', '750px'],
            content: 'https://www.php.cn/help/ask?q='+encodeURIComponent(ask),
            fixed: true, // 不固定
            //maxmin: true,
            shadeClose: true,
            title:"智能小助手",
            btnAlign: 'c',
            yes: function(index, layero){
                // 获取 iframe 的窗口对象
                var iframeWin =  window[layero.find('iframe')[0]['name']];
                var elemMark = iframeWin.$('#mark'); // 获得 iframe 中某个输入框元素
                var value = elemMark.val();
                if($.trim(value) === '') return elemMark.focus();
                // 显示获得的值
                layer.msg('获得 iframe 中的输入框标记值:'+ value);
            }
        });
    }

</script>
<!--底部浮动层-->
<!--
    <div class="phpFudong">
        <div class="phpFudongIn">
            <div class="phpFudongImg"></div>
            <div class="phpFudongXue">登录PHP中文网,和优秀的人一起学习!</div>
            <div class="phpFudongQuan">全站<span>2000+</span>教程免费学</div>
            <div class="phpFudongCode"><a href="javascript:;" id="login" title="微信扫码登录">微信扫码登录</a></div>
            <div class="phpGuanbi" onclick="$('.phpFudong').hide();"></div>
            <div class="clear"></div>
        </div>
    </div>
--><!--底部浮动层 end-->
<!--侧导航-->
<style>
    .layui-fixbar{display: none;}
</style>
<div class="phpSdhBox" style="height:240px !important;">
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a href="/k24.html" target="_blank" class="hover" title="PHP学习">
                    <b class="icon1"></b>
                    <p>PHP学习</p>
                </a>
            </div>
        </div>
    </li>
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a href="https://www.php.cn/blog/detail/1047189.html" target="_blank">
                    <b class="icon2"></b>
                    <p>技术支持</p>
                </a>
            </div>
        </div>
    </li>
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a href="#">
                    <b class="icon6"></b>
                    <p>返回顶部</p>
                </a>
            </div>
        </div>
    </li>
</div>
<!--侧导航 end-->
<!-- 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', '7']);
    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>
    setCookie('is_article', 1, 1);
</script>
</body>
</html>