May I ask a simple question about PHP. Dynamic page content-php Tutorial

Source: Internet
Author: User
Ask a simple PHP question. About the dynamic content of the page! & Lt; div & nbsp; & gt; & lt; h2 & gt; & lt; a & nbsp; href & nbsp; index. php? Cproject & amp; adetail & amp; & gt; here we need to dynamically set & lt; a & gt; & lt; h2 & gt; & lt; div & nbsp ask a simple PHP question. 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, the data obtained from the database needs to be recycled N times. Replace "dynamic settings here" with the value in the database.
How can I use PHP?
Include this section in Is html output with echo?
I think there should be a better way.

Please take care of the first time you use PHP.



------ Solution ----------------------
You can use the template engine.
------ Solution ----------------------
There is no better way to output html with echo.
------ Solution ----------------------
Smarty
------ Solution ----------------------

$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++){
?>















>




>











}
?>

------ Solution ----------------------
Http://bbs.csdn.net/topics/391013945

Just now, a buddy's post directly took away more than the gourd pictorial. the specific details are Baidu.
------ Solution ----------------------

$ Str_1 = 'first dynamic ';
$ Str_2 = 'first dynamic ';
$ Str_3 = 'first dynamic ';
$ Str_4 = 'first dynamic
$ Url = 'id of the url ';
?>















>




>





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.