An article detailing the principles of the PHP template engine (with code examples)

藏色散人
Release: 2023-04-11 07:26:02
forward
3467 people have browsed it

Developing a web project is usually divided into two parts. One part is GUI, that is, interface and art, written using HTML, CSS, JS, and the other part is business logic, that is, programs and functions, written using PHP. The template engine is the "bridge" that connects the two parts. It can be understood as a PHP class, which defines many methods to load the original output of PHP into the interface style and then output it.

The code written before using the template is like this:





<?php echo $title; ?>



Copy after login

In this way, there is no separation between art and logic. Simply put, PHP programmers must not only write programs but also be proficient in art. This It is often very difficult, so the two parts of the work need to be separated.

Let’s create a simple template engine as an example to better understand the principles of the template engine.

As mentioned before, developing a web project is divided into two parts: GUI and business logic, so we create two folders, one named "templates", which stores templates, create a new tpl.html file, and name the other For "PHP", which stores business logic, create a new index.php file.

tpl.html file code usually looks like this:



<{$title}>

<{ $content;}>

Copy after login

It can be seen that compared with the previous code, tpl.html only has html code and no php code, but new ones have been added Tags, this type of tag is defined by yourself, and the content inside can only be recognized after being compiled by the template engine. The compiled files are stored in the "templates_c" folder. This file is mainly used for interface design, and will use a large number of CSS, JS and other technologies.

At this time, tpl.html and index.php are still separated and do not interfere with each other, so they need a "bridge" connection, that is, the template engine, which is actually a PHP class, so a mytpl can be created here. PHP file class.php.

The mytpl.class.php file usually defines a class MyTpl. An array tpl_var[] needs to be defined in the class to store the parameters of the custom content tag in tpl.html. In addition, some methods need to be defined. These methods The main purpose is to convert unrecognized content tags in tpl.hml into PHP statements, and then write them to tpl_c.html in a "templates_c" folder. This process is called compilation.

Usually the code of the tpl_c.html file is like this:



<?php echo $this->tpl_var[“title”]; ?></head>

<body><?php echo $this->tpl_var[“content”]; ?}></body>

</html></pre><div class="contentsignin">Copy after login</div></div>
<p> It can be seen that the above code can be recognized because the custom content tags have been replaced with PHP statements. But we still don’t know what the values ​​of title and content are. At this time, the index.php created before will come into play. <br></p>
<h3 id="indexphp通常它代码是这样的">index.php Usually its code is like this: </h3>
<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">include  “tpl.class.php文件”;//加载模板引擎

$tpl = new MyTpl();//实例化一个模板类

$title = “标题”;

$content = “内容”;

$tpl->assign(“title”,$title);//调用模板类中的方法,分配变量

$tpl->assign(“content”,$content);

$tpl->display(“tpl.html”);//调用模板类中的方法,用于显示编译后的内容</pre><div class="contentsignin">Copy after login</div></div>
<p>The above code is just some simple description code. The values ​​of the variables can be directly defined or obtained from the database. In addition, the file can also write some complex PHP programs, which is the business mentioned before. logic. </p>
<p>In this way, the work of GUI and business logic is separated. Art designers only need to write template files to change the web interface, while PHP programmers can concentrate on writing their own programs. </p>
<p>Companies generally have their own template engines, and there is usually no need to write the template engine yourself, because there are already some very mature template engines on the market, such as Smarty. We only need to know how to use it. Enough. </p>
<p>Recommended learning: "<a href="https://www.php.cn/course/list/29.html" target="_blank">PHP Video Tutorial</a>"<br></p><p>The above is the detailed content of An article detailing the principles of the PHP template engine (with code examples). For more information, please follow other related articles on the PHP Chinese website!</p>                </div>
            </div>
            <div style="height: 25px;">
                                <div class="wzconBq" style="display: inline-flex;">
                    <span>Related labels:</span>
                    <div class="wzcbqd">
                        <a onclick="hits_log(2,'www',this);" href-data="http://www.php.cn/search?word=php" target="_blank">php</a> <a onclick="hits_log(2,'www',this);" href-data="http://www.php.cn/search?word=templateengine" target="_blank">template engine</a>                    </div>
                </div>
                                <div style="display: inline-flex;float: right; color:#333333;">source:cnblogs.com</div>
                            </div>
            <div class="wzconOtherwz">
                                    <a href="http://www.php.cn/faq/494709.html" title="The latest brief analysis of PHP features, kernel and architecture in 2022">
                        <span>Previous article:The latest brief analysis of PHP features, kernel and architecture in 2022</span>
                    </a>
                                    <a href="http://www.php.cn/faq/494711.html"  title="Teach you to create a virtual host and run php projects (phpstudy + wamp)">
                        <span>Next article:Teach you to create a virtual host and run php projects (phpstudy + wamp)</span>
                    </a>
                            </div>
            <div class="wzconShengming">
                <!-- <img src="/static/images/images/benzhanshengming.png" /> -->
                <div class="bzsmdiv">Statement of this Website</div>
                <div>The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn</div>
            </div>
           <div class="wwads-cn wwads-horizontal" data-id="156" style="max-width:955px"></div>
            <div class="wzconZzwz">
                <div class="wzconZzwztitle">Latest Articles by Author</div>
                <ul>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/526298.html">12 points to note when sharing interface design documents</a>
                            </div>
                            <div>2023-04-24 11:00:01</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/526297.html">Let's talk about how the front-end obtains battery information</a>
                            </div>
                            <div>2023-04-24 10:55:51</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/526211.html">Detailed graphic explanation of how to integrate the Ace code editor in a Vue project</a>
                            </div>
                            <div>2023-04-24 10:52:44</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/525451.html">Use eight demos to understand the five major features of Go language defer</a>
                            </div>
                            <div>2023-04-23 17:40:51</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/525450.html">Detailed description of the serious time-consuming problem of file_get_contents and getimagesize</a>
                            </div>
                            <div>2023-04-23 17:38:02</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/525448.html">Share a PHP free verification code (with code)</a>
                            </div>
                            <div>2023-04-23 17:34:02</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/525031.html">What does yum mean in linux</a>
                            </div>
                            <div>2023-04-23 10:15:45</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/524978.html">what is linux jboss</a>
                            </div>
                            <div>2023-04-23 10:10:52</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/524049.html">Share redis multi-dimensional ranking ideas</a>
                            </div>
                            <div>2023-04-21 16:01:59</div>
                        </li>
                                            <li>
                            <div class="wzczzwzli">
                                <span class="layui-badge-dots"></span>
                                <a target="_blank" href="http://www.php.cn/faq/524047.html">One article explains in detail the implementation of grpc server through php+roadrunner</a>
                            </div>
                            <div>2023-04-21 15:58:01</div>
                        </li>
                                    </ul>
            </div>
            <div class="wzconZzwz">
                <div class="wzconZzwztitle">Latest Issues</div>
                <div class="wdsyContent">
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="http://www.php.cn/wenda/173477.html"  target="_blank" title="Using Laravel 8's blade asset to display images but loading from resources subfolder" class="wdcdcTitle">Using Laravel 8's blade asset to display images but loading from resources subfolder</a>
                            <a href="http://www.php.cn/wenda/173477.html" class="wdcdcCons">I'm pretty new to Laravel, so please bear with me. I'm copying a framework I developed in ...</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan"> From 2023-11-09 12:47:02</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <div class="wdcdcirdz flexRow ira">  <b class="wdcdcirdzi"></b>0 </div>
                                    <div class="wdcdcirpl flexRow ira"><b  class="wdcdcirpli"></b>1</div>
                                    <div class="wdcdcirwatch flexRow ira"><b  class="wdcdcirwatchi"></b>314</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="http://www.php.cn/wenda/173456.html"  target="_blank" title="Vue js: Troubleshooting - Reading '$refs' property of undefined" class="wdcdcTitle">Vue js: Troubleshooting - Reading '$refs' property of undefined</a>
                            <a href="http://www.php.cn/wenda/173456.html" class="wdcdcCons">Getting the error Cannot read property of undefined (reading '$refs') even though I have a...</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan"> From 2023-11-07 23:34:12</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <div class="wdcdcirdz flexRow ira">  <b class="wdcdcirdzi"></b>0 </div>
                                    <div class="wdcdcirpl flexRow ira"><b  class="wdcdcirpli"></b>1</div>
                                    <div class="wdcdcirwatch flexRow ira"><b  class="wdcdcirwatchi"></b>305</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="http://www.php.cn/wenda/173418.html"  target="_blank" title=""Using the v-for directive for array element and attribute destructuring"" class="wdcdcTitle">"Using the v-for directive for array element and attribute destructuring"</a>
                            <a href="http://www.php.cn/wenda/173418.html" class="wdcdcCons">When using an array of objects, is it possible in a v-for loop to simultaneously assign th...</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan"> From 2023-11-05 17:37:54</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <div class="wdcdcirdz flexRow ira">  <b class="wdcdcirdzi"></b>0 </div>
                                    <div class="wdcdcirpl flexRow ira"><b  class="wdcdcirpli"></b>1</div>
                                    <div class="wdcdcirwatch flexRow ira"><b  class="wdcdcirwatchi"></b>216</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="http://www.php.cn/wenda/173393.html"  target="_blank" title="How to make API call in created hook in Vue 3?" class="wdcdcTitle">How to make API call in created hook in Vue 3?</a>
                            <a href="http://www.php.cn/wenda/173393.html" class="wdcdcCons">Returning to vue after a long break. In my solution I'm using composition api and after cr...</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan"> From 2023-11-04 08:48:38</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <div class="wdcdcirdz flexRow ira">  <b class="wdcdcirdzi"></b>0 </div>
                                    <div class="wdcdcirpl flexRow ira"><b  class="wdcdcirpli"></b>2</div>
                                    <div class="wdcdcirwatch flexRow ira"><b  class="wdcdcirwatchi"></b>248</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="wdsyConLine wdsyConLine2"></div>
                                        <div class="wdsyConDiv flexRow wdsyConDiv1">
                        <div class="wdcdContent flexColumn">
                            <a href="http://www.php.cn/wenda/173387.html"  target="_blank" title="Issues with Vue.js 3 and Pinia Getters" class="wdcdcTitle">Issues with Vue.js 3 and Pinia Getters</a>
                            <a href="http://www.php.cn/wenda/173387.html" class="wdcdcCons">I'm switching from Angular to Vue.js and trying to understand its architecture. I'm curren...</a>
                            <div class="wdcdcInfo flexRow">
                                <div class="wdcdcileft">
                                    <span class="wdcdciSpan"> From 2023-11-03 18:52:56</span>
                                </div>
                                <div class="wdcdciright flexRow">
                                    <div class="wdcdcirdz flexRow ira">  <b class="wdcdcirdzi"></b>0 </div>
                                    <div class="wdcdcirpl flexRow ira"><b  class="wdcdcirpli"></b>1</div>
                                    <div class="wdcdcirwatch flexRow ira"><b  class="wdcdcirwatchi"></b>244</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="wdsyConLine wdsyConLine2"></div>
                                    </div>
            </div>
            <div class="wzconZt" >
                <div class="wzczt-title">
                    <div>Related Topics</div>
                    <a href="http://www.php.cn/faq/zt" target="_blank">More>
                    </a>
                </div>
                <div class="wzcttlist">
                    <ul>
                                                <li class="ul-li">
                            <a target="_blank" href="http://www.php.cn/faq/phpwjzmdk"><img src="https://img.php.cn/upload/subject/202407/22/2024072214120868901.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="How to open php file" /> </a>
                            <a target="_blank" href="http://www.php.cn/faq/phpwjzmdk" class="title-a-spanl" title="How to open php file"><span>How to open php file</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="http://www.php.cn/faq/phpzmqcszys"><img src="https://img.php.cn/upload/subject/202407/22/2024072214004499289.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="How to remove the first few elements of an array in php" /> </a>
                            <a target="_blank" href="http://www.php.cn/faq/phpzmqcszys" class="title-a-spanl" title="How to remove the first few elements of an array in php"><span>How to remove the first few elements of an array in php</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="http://www.php.cn/faq/phpfxlsb"><img src="https://img.php.cn/upload/subject/202407/22/2024072214003558557.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="What to do if php deserialization fails" /> </a>
                            <a target="_blank" href="http://www.php.cn/faq/phpfxlsb" class="title-a-spanl" title="What to do if php deserialization fails"><span>What to do if php deserialization fails</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="http://www.php.cn/faq/phpljmssql"><img src="https://img.php.cn/upload/subject/202407/22/2024072213560082376.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="How to connect php to mssql database" /> </a>
                            <a target="_blank" href="http://www.php.cn/faq/phpljmssql" class="title-a-spanl" title="How to connect php to mssql database"><span>How to connect php to mssql database</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="http://www.php.cn/faq/phpljmssqlsjk"><img src="https://img.php.cn/upload/subject/202407/22/2024072213555538594.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="How to connect php to mssql database" /> </a>
                            <a target="_blank" href="http://www.php.cn/faq/phpljmssqlsjk" class="title-a-spanl" title="How to connect php to mssql database"><span>How to connect php to mssql database</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="http://www.php.cn/faq/htmlzmsc"><img src="https://img.php.cn/upload/subject/202407/22/2024072213512540557.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="How to upload html" /> </a>
                            <a target="_blank" href="http://www.php.cn/faq/htmlzmsc" class="title-a-spanl" title="How to upload html"><span>How to upload html</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="http://www.php.cn/faq/phpcxlmzmjj"><img src="https://img.php.cn/upload/subject/202407/22/2024072213494787127.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="How to solve garbled characters in PHP" /> </a>
                            <a target="_blank" href="http://www.php.cn/faq/phpcxlmzmjj" class="title-a-spanl" title="How to solve garbled characters in PHP"><span>How to solve garbled characters in PHP</span> </a>
                        </li>
                                                <li class="ul-li">
                            <a target="_blank" href="http://www.php.cn/faq/phpwjzmzsjsdk"><img src="https://img.php.cn/upload/subject/202407/22/2024072213484482977.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="How to open php files on mobile phone" /> </a>
                            <a target="_blank" href="http://www.php.cn/faq/phpwjzmzsjsdk" class="title-a-spanl" title="How to open php files on mobile phone"><span>How to open php files on mobile phone</span> </a>
                        </li>
                                            </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="phpwzright">
        <div class="wzrOne">
            <div class="wzroTitle">Popular Recommendations</div>
            <div class="wzroList">
                <ul>
                                                <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" title="php实现图片批量下载到本地实例" href="http://www.php.cn/faq/49083.html">php实现图片批量下载到本地实例</a>
                                </div>
                            </li>
                                                <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" title="循环大量数据导致内存超出,不增加内存如何解决该问题" href="http://www.php.cn/faq/255458.html">循环大量数据导致内存超出,不增加内存如何解决该问题</a>
                                </div>
                            </li>
                                                <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" title="How to set up hosts on Mac computer (steps with pictures and text)" href="http://www.php.cn/faq/448310.html">How to set up hosts on Mac computer (steps with pictures and text)</a>
                                </div>
                            </li>
                                                <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" title="Quickly build a simple QQ robot with PHP" href="http://www.php.cn/faq/448391.html">Quickly build a simple QQ robot with PHP</a>
                                </div>
                            </li>
                                                <li>
                                <div class="wzczzwzli">
                                    <span class="layui-badge-dots wzrolr"></span>
                                    <a style="height: auto;" title="API common signature verification methods (PHP implementation)" href="http://www.php.cn/faq/448286.html">API common signature verification methods (PHP implementation)</a>
                                </div>
                            </li>
                                    </ul>
            </div>
        </div>
        <div class="wzrThree">
            <div class="wzrthree-title">
                <div>Popular Tutorials</div>
                <a target="_blank" href="http://www.php.cn/course.html">More>
                </a>
            </div>
            <div class="wzrthreelist swiper2">
                <div class="wzrthreeTab  swiper-wrapper">
                    <div class="check tabdiv swiper-slide" data-id="one">Related Tutorials <div></div></div>
                    <div class="tabdiv swiper-slide" data-id="two">Popular Recommendations<div></div></div>
                    <div class="tabdiv swiper-slide" data-id="three">Latest courses<div></div></div>
                </div>
                <ul class="one">
                                                <li>
                                <a target="_blank" href="http://www.php.cn/course/1416.html" title="PHP Advanced Tutorial: Mastering Object-Oriented Development from Basic to Deep" class="wzrthreelaimg">
                                    <img src="https://img.php.cn/upload/course/000/000/068/6278b2ec4fa28483.jpg" alt="PHP Advanced Tutorial: Mastering Object-Oriented Development from Basic to Deep"/>
                                </a>
                                <div class="wzrthree-right">
                                    <a target="_blank" title="PHP Advanced Tutorial: Mastering Object-Oriented Development from Basic to Deep" href="http://www.php.cn/course/1416.html">PHP Advanced Tutorial: Mastering Object-Oriented Development from Basic to Deep</a>
                                    <div class="wzrthreerb">
                                        <div>180985 <b class="kclbcollectb"></b></div>
                                     
                                                                                    <div class="courseICollection" data-id="1416">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                            </div>
                                </div>
                            </li>
                                                <li>
                                <a target="_blank" href="http://www.php.cn/course/1419.html" title="PHP file upload—a must-learn tutorial from entry to practical series" class="wzrthreelaimg">
                                    <img src="https://img.php.cn/upload/course/000/000/068/6282079ba5097121.jpg" alt="PHP file upload—a must-learn tutorial from entry to practical series"/>
                                </a>
                                <div class="wzrthree-right">
                                    <a target="_blank" title="PHP file upload—a must-learn tutorial from entry to practical series" href="http://www.php.cn/course/1419.html">PHP file upload—a must-learn tutorial from entry to practical series</a>
                                    <div class="wzrthreerb">
                                        <div>32521 <b class="kclbcollectb"></b></div>
                                     
                                                                                    <div class="courseICollection" data-id="1419">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                            </div>
                                </div>
                            </li>
                                                <li>
                                <a target="_blank" href="http://www.php.cn/course/1427.html" title="Design of blog system based on PHP7+MVC" class="wzrthreelaimg">
                                    <img src="https://img.php.cn/upload/course/000/000/068/629dc8e8356ad204.png" alt="Design of blog system based on PHP7+MVC"/>
                                </a>
                                <div class="wzrthree-right">
                                    <a target="_blank" title="Design of blog system based on PHP7+MVC" href="http://www.php.cn/course/1427.html">Design of blog system based on PHP7+MVC</a>
                                    <div class="wzrthreerb">
                                        <div>411661 <b class="kclbcollectb"></b></div>
                                     
                                                                                    <div class="courseICollection" data-id="1427">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                            </div>
                                </div>
                            </li>
                                    </ul>
                <ul class="two" style="display: none;">
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/812.html" title="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/041/620debc3eab3f377.jpg" alt="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)" href="http://www.php.cn/course/812.html">The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)</a>
                                <div class="wzrthreerb">
                                    <div >1387900 times of learning</div>
                                                                                <div class="courseICollection" data-id="812">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/286.html" title="JAVA Beginner's Video Tutorial" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/068/62590a2bacfd9379.png" alt="JAVA Beginner's Video Tutorial"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="JAVA Beginner's Video Tutorial" href="http://www.php.cn/course/286.html">JAVA Beginner's Video Tutorial</a>
                                <div class="wzrthreerb">
                                    <div >2301744 times of learning</div>
                                                                                <div class="courseICollection" data-id="286">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/504.html" title="Little Turtle's zero-based introduction to learning Python video tutorial" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/068/62590a67ce3a6655.png" alt="Little Turtle's zero-based introduction to learning Python video tutorial"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="Little Turtle's zero-based introduction to learning Python video tutorial" href="http://www.php.cn/course/504.html">Little Turtle's zero-based introduction to learning Python video tutorial</a>
                                <div class="wzrthreerb">
                                    <div >488540 times of learning</div>
                                                                                <div class="courseICollection" data-id="504">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/901.html" title="Quick introduction to web front-end development" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/067/64be28a53a4f6310.png" alt="Quick introduction to web front-end development"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="Quick introduction to web front-end development" href="http://www.php.cn/course/901.html">Quick introduction to web front-end development</a>
                                <div class="wzrthreerb">
                                    <div >212902 times of learning</div>
                                                                                <div class="courseICollection" data-id="901">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/234.html" title="Master PS video tutorials from scratch" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/068/62611f57ed0d4840.jpg" alt="Master PS video tutorials from scratch"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="Master PS video tutorials from scratch" href="http://www.php.cn/course/234.html">Master PS video tutorials from scratch</a>
                                <div class="wzrthreerb">
                                    <div >830423 times of learning</div>
                                                                                <div class="courseICollection" data-id="234">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                    </ul>
                <ul class="three" style="display: none;">
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/1648.html" title="[Web front-end] Node.js quick start" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/067/662b5d34ba7c0227.png" alt="[Web front-end] Node.js quick start"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="[Web front-end] Node.js quick start" href="http://www.php.cn/course/1648.html">[Web front-end] Node.js quick start</a>
                                <div class="wzrthreerb">
                                    <div >2112 times of learning</div>
                                                                                <div class="courseICollection" data-id="1648">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/1647.html" title="Complete collection of foreign web development full-stack courses" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/067/6628cc96e310c937.png" alt="Complete collection of foreign web development full-stack courses"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="Complete collection of foreign web development full-stack courses" href="http://www.php.cn/course/1647.html">Complete collection of foreign web development full-stack courses</a>
                                <div class="wzrthreerb">
                                    <div >1711 times of learning</div>
                                                                                <div class="courseICollection" data-id="1647">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/1646.html" title="Go language practical GraphQL" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/067/662221173504a436.png" alt="Go language practical GraphQL"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="Go language practical GraphQL" href="http://www.php.cn/course/1646.html">Go language practical GraphQL</a>
                                <div class="wzrthreerb">
                                    <div >1382 times of learning</div>
                                                                                <div class="courseICollection" data-id="1646">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/1645.html" title="550W fan master learns JavaScript from scratch step by step" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/067/662077e163124646.png" alt="550W fan master learns JavaScript from scratch step by step"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="550W fan master learns JavaScript from scratch step by step" href="http://www.php.cn/course/1645.html">550W fan master learns JavaScript from scratch step by step</a>
                                <div class="wzrthreerb">
                                    <div >397 times of learning</div>
                                                                                <div class="courseICollection" data-id="1645">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                            <li>
                            <a target="_blank" href="http://www.php.cn/course/1644.html" title="Python master Mosh, a beginner with zero basic knowledge can get started in 6 hours" class="wzrthreelaimg">
                                <img src="https://img.php.cn/upload/course/000/000/067/6616418ca80b8916.png" alt="Python master Mosh, a beginner with zero basic knowledge can get started in 6 hours"/>
                            </a>
                            <div class="wzrthree-right">
                                <a target="_blank" title="Python master Mosh, a beginner with zero basic knowledge can get started in 6 hours" href="http://www.php.cn/course/1644.html">Python master Mosh, a beginner with zero basic knowledge can get started in 6 hours</a>
                                <div class="wzrthreerb">
                                    <div >7509 times of learning</div>
                                                                                <div class="courseICollection" data-id="1644">
                                                <b class="nofollow small-nocollect"></b>
                                            </div>
                                                                        </div>
                            </div>
                        </li>
                                    </ul>
            </div>
            <script>
                var mySwiper = new Swiper('.swiper2', {
                            autoplay: false,//可选选项,自动滑动
                            slidesPerView : 'auto',
                        })
                $('.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>Latest Downloads</div>
                <a href="http://www.php.cn/xiazai">More>
                </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
                    })
                })
            </script>
            <div class="wzrfourList swiper3">
                <div class="wzrfourlTab swiper-wrapper">
                    <div class="check swiper-slide" data-id="onef">Web Effects <div></div></div>
                    <div class="swiper-slide" data-id="twof">Website Source Code<div></div></div>
                    <div class="swiper-slide" data-id="threef">Website Materials<div></div></div>
                    <div class="swiper-slide" data-id="fourf">Front End Template<div></div></div>
                </div>
                <ul class="onef">
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="jQuery enterprise message form contact code" href="http://www.php.cn/xiazai/js/8071">[form button] jQuery enterprise message form contact code</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="HTML5 MP3 music box playback effects" href="http://www.php.cn/xiazai/js/8070">[Player special effects] HTML5 MP3 music box playback effects</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="HTML5 cool particle animation navigation menu special effects" href="http://www.php.cn/xiazai/js/8069">[Menu navigation] HTML5 cool particle animation navigation menu special effects</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="jQuery visual form drag and drop editing code" href="http://www.php.cn/xiazai/js/8068">[form button] jQuery visual form drag and drop editing code</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="VUE.JS imitation Kugou music player code" href="http://www.php.cn/xiazai/js/8067">[Player special effects] VUE.JS imitation Kugou music player code</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="Classic html5 pushing box game" href="http://www.php.cn/xiazai/js/8066">[html5 special effects] Classic html5 pushing box game</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="jQuery scrolling to add or reduce image effects" href="http://www.php.cn/xiazai/js/8065">[Picture special effects] jQuery scrolling to add or reduce image effects</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a target="_blank"  title="CSS3 personal album cover hover zoom effect" href="http://www.php.cn/xiazai/js/8064">[Photo album effects] CSS3 personal album cover hover zoom effect</a>
                            </div>
                        </li>
                                    </ul>
                <ul class="twof" style="display:none">
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8328" title="Home Decor Cleaning and Repair Service Company Website Template" target="_blank">[Front-end template] Home Decor Cleaning and Repair Service Company Website Template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8327" title="Fresh color personal resume guide page template" target="_blank">[Front-end template] Fresh color personal resume guide page template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8326" title="Designer Creative Job Resume Web Template" target="_blank">[Front-end template] Designer Creative Job Resume Web Template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8325" title="Modern engineering construction company website template" target="_blank">[Front-end template] Modern engineering construction company website template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8324" title="Responsive HTML5 template for educational service institutions" target="_blank">[Front-end template] Responsive HTML5 template for educational service institutions</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8323" title="Online e-book store mall website template" target="_blank">[Front-end template] Online e-book store mall website template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8322" title="IT technology solves Internet company website template" target="_blank">[Front-end template] IT technology solves Internet company website template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8321" title="Purple style foreign exchange trading service website template" target="_blank">[Front-end template] Purple style foreign exchange trading service website template</a>
                            </div>
                        </li>
                                    </ul>
                <ul class="threef" style="display:none">
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/sucai/3078"  target="_blank"  title="Cute summer elements vector material (EPS PNG)">[PNG material] Cute summer elements vector material (EPS PNG)</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/sucai/3077"  target="_blank"  title="Four red 2023 graduation badges vector material (AI EPS PNG)">[PNG material] Four red 2023 graduation badges vector material (AI EPS PNG)</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/sucai/3076"  target="_blank"  title="Singing bird and cart filled with flowers design spring banner vector material (AI EPS)">[banner picture] Singing bird and cart filled with flowers design spring banner vector material (AI EPS)</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/sucai/3075"  target="_blank"  title="Golden graduation cap vector material (EPS PNG)">[PNG material] Golden graduation cap vector material (EPS PNG)</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/sucai/3074"  target="_blank"  title="Black and white style mountain icon vector material (EPS PNG)">[PNG material] Black and white style mountain icon vector material (EPS PNG)</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/sucai/3073"  target="_blank"  title="Superhero silhouette vector material (EPS PNG) with different color cloaks and different poses">[PNG material] Superhero silhouette vector material (EPS PNG) with different color cloaks and different poses</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/sucai/3072"  target="_blank"  title="Flat style Arbor Day banner vector material (AI+EPS)">[banner picture] Flat style Arbor Day banner vector material (AI+EPS)</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/sucai/3071"  target="_blank"  title="Nine comic-style exploding chat bubbles vector material (EPS+PNG)">[PNG material] Nine comic-style exploding chat bubbles vector material (EPS+PNG)</a>
                            </div>
                        </li>
                                    </ul>
                <ul class="fourf" style="display:none">
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8328"  target="_blank" title="Home Decor Cleaning and Repair Service Company Website Template">[Front-end template] Home Decor Cleaning and Repair Service Company Website Template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8327"  target="_blank" title="Fresh color personal resume guide page template">[Front-end template] Fresh color personal resume guide page template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8326"  target="_blank" title="Designer Creative Job Resume Web Template">[Front-end template] Designer Creative Job Resume Web Template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8325"  target="_blank" title="Modern engineering construction company website template">[Front-end template] Modern engineering construction company website template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8324"  target="_blank" title="Responsive HTML5 template for educational service institutions">[Front-end template] Responsive HTML5 template for educational service institutions</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8323"  target="_blank" title="Online e-book store mall website template">[Front-end template] Online e-book store mall website template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8322"  target="_blank" title="IT technology solves Internet company website template">[Front-end template] IT technology solves Internet company website template</a>
                            </div>
                        </li>
                                            <li>
                            <div class="wzrfourli">
                                <span class="layui-badge-dots wzrflr"></span>
                                <a href="http://www.php.cn/xiazai/code/8321"  target="_blank" title="Purple style foreign exchange trading service website template">[Front-end template] Purple style foreign exchange trading service website template</a>
                            </div>
                        </li>
                                    </ul>
            </div>
            <script>
                var mySwiper = new Swiper('.swiper3', {
                            autoplay: false,//可选选项,自动滑动
                            slidesPerView : 'auto',
                        })
                $('.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>
<div class="phpFoot">
    <div class="phpFootIn">
        <div class="phpFootCont">
            <div class="phpFootLeft">
                <dl>
                    <dt>
                        <a href="http://www.php.cn/about/us.html" rel="nofollow" target="_blank" title="About us" class="cBlack">About us</a>
                        <a href="http://www.php.cn/about/disclaimer.html" rel="nofollow" target="_blank" title="Disclaimer" class="cBlack">Disclaimer</a>
                        <a href="http://www.php.cn/update/article_0_1.html"   target="_blank" title="Sitemap" class="cBlack">Sitemap</a>
                        <div class="clear"></div>
                    </dt>
                    <dd class="cont1">php.cn:Public welfare online PHP training,Help PHP learners grow quickly!</dd>
                </dl>
              
            </div>
        </div>
    </div>
    </div>

<input type="hidden" id="verifycode" value="/captcha.html">
<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>

<script src="/static/js/common_new.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js?1722046965"></script>
<script src="https://vdse.bdstatic.com//search-video.v1.min.js"></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>
<script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script>
</body>
</html>