PHP HTML Template with Loop capabilities

前端 未结 3 529
故里飘歌
故里飘歌 2021-01-07 07:28

I would like to ask some help and ideas on how to implement a loop inside the template. I can do foearch below but how can i include it to the template and show it in the re

3条回答
  •  遥遥无期
    2021-01-07 07:37

    Your PHP code:

    $htmldata ="";
    
    ($results as $row) {
     $name = $row['name'];
     $address = $row['address'];
    $htmldata .="
    
    

    Hello William!

    The time is: 03/10/04

    Embedded PHP works too!

    ".$name."

    ".$address."

    "; }

    Then in your template design.html, you will pass the $htmltable variable and embedd there:

    
    
    #title#
    
    
    

    Hello #name#!

    The time is: #datetime#

    Embedded PHP works too!

    "; ?>

提交回复
热议问题