How can I splice html with php for concurrent output?

Source: Internet
Author: User
& Quot; Demo01.phppublicstaticfunctionbuildFullPage () {$ data [[& #39; type & #39; & gt; & #39; header & #39;], [& #39; type & #39; & gt; & #39; companys & #39;, & #39; com_id & #39; & gt; & #39; Beijing & #39 ;, defines many variables. the layout of each content is the same], [& #39; type & #39; & gt; & #39; company php

// Demo01.php public static function buildFullPage () {$ data = [['type' => 'header'], ['type' => 'companys ', 'com _ id' => 'Beijing', // defines a lot of variables. the layout of each content is the same], ['type' => 'companys ', 'com _ id' => 'Shanghai',], ['type' => 'companys', 'com _ id' => 'shenzhen',], ['type' => 'companys', 'com _ id' => 'hangzhou',], ['type' => 'footer ']; foreach ($ data as $ type => $ type_value) {switch ($ type) {case 'header': echo Demo01: buildHeader (); case 'companys': echo Demo01:: buildCom ($ data); case 'footer ': echo Demo01: buildFooter ();}}}

The page layout is usually a header with four content (that is, each content is a company introduction, and the template is the same) and a footer. in this way, only one content is displayed each time, what should I do if I want to display all of them?

//index.php 
   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.