The smartest way to generate duplicate HTML source code. Using PHP?
P粉146080556
P粉146080556 2023-09-10 16:37:09
0
1
465

Hi, I would like to know what is the sensible way to generate duplicate HTML source code (shown below). Let's say I have 30 rows numbered from 1 to 30. I have a lot of pages like this that need this structure. I've used a PHP loop to generate this code in the page itself, since I'm using PHP in my project anyway.

My question is, is this a wise approach? What is the best practice in this situation? I'm not sure it's wise to use PHP to generate HTML every time in a page. Or is it?

Thank you for your guidance or suggestions.

 Picture 1   Picture 2  etc..

P粉146080556
P粉146080556

reply all (1)
P粉014293738

This is exactly what PHP is for: generating HTML code.

You can use a simple for loop:

  Picture <?= $i ?>  
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!