PHP pulls out a lot of data from the database and loops it out in the table in the HTML page.

Source: Internet
Author: User
PHP takes a lot of data out of the database and loops it out in the table in the HTML page.
PHP takes a lot of data out of the database and loops it out in the table in the HTML page. Used to be thinkphp frame, there are tag, and that's it. You can't use the thinkphp framework now, use native PHP. How does the data retrieved in the background loop out into the HTML table?
For example, $result to find out the multidimensional array, there are id,name,age three fields. How do I get their corresponding output to an HTML table?
------to solve the idea----------------------










$array = Array (1, 2, 3, 4, 5, 6, 7); foreach ($array as $value) {?> }?>


Since it is mixed, this should be possible.
or HTML tag processing directly in PHP ~ ~
------to solve the idea----------------------
References:
Quote: References:











$array = Array (1, 2, 3, 4, 5, 6, 7); foreach ($array as $value) {?> }?>


Since it is mixed, this should be possible.
or HTML tag processing directly in PHP ~ ~


References:










$array = Array (1, 2, 3, 4, 5, 6, 7); foreach ($array as $value) {?> }?>


Since it is mixed, this should be possible.
or HTML tag processing directly in PHP ~ ~

I have to know this method, a little trouble, there is a simpler way? Just like Thinkphp's. label as

Native PHP does not provide a similar tag, that is provided by the thinkphp framework rather than PHP provided, similar to the smarty tag, is a medium, rather than PHP itself provided, so you can use the Smarty template, which provides similar tags
------to solve the idea----------------------
Not like that, huh? The label boils down to a foreach traversal.
  • 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.