Ask a simple question about PHP. About the dynamic content of the page

Source: Internet
Author: User
Ask a simple question about PHP. About the dynamic content of the page!



Dynamic settings are required here





  • Dynamic settings are required here











Dynamic settings are required here





Dynamic settings are required here
Dynamic settings are required here
Dynamic settings are required here
Dynamic settings are required here



In the above section, you need to loop the data out of the database n times. and replace "Here needs dynamic settings" with the values in the database.
How do you write in PHP?
Is this part of the text included in And then use echo to output the HTML?
I think there should be a better way.

First time with PHP, please take care of it.



------to solve the idea----------------------
You can use the template engine
------to solve the idea----------------------
is to use Echo to output HTML, there is no better way
------to solve the idea----------------------
Smarty
------to solve the idea----------------------

$data = Array (
Array (' a ' = ' = ' 1 ', ' b ' = ' 2 ', ' c ' = ' 3 ', ' d ' = ' 4 ', ' e ' = ' 5 ', ' f ' = ' 6 '),
Array (' a ' = ' = ' A ', ' b ' = = ' B ', ' c ' = = ' C ', ' d ' = = ' d ', ' e ' = = ' E ', ' f ' = = ' f '),
);


For ($i =0, $len =count ($data), $i < $len; $i + +) {
?>















>




>











}
?>

------to solve the idea----------------------
http://bbs.csdn.net/topics/391013945

Just a buddy's post, take Bishi directly, the specific details of their own Baidu
------to solve the idea----------------------

$str _1= ' first dynamic ';
$str _2= ' first dynamic ';
$str _3= ' first dynamic ';
$str _4= ' first dynamic
$url = ' URL corresponding to the ID ';
?>














>




>





Dynamic settings are required here
Dynamic settings are required here
Dynamic settings are required here
Dynamic settings are required here


  • 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.