How to cyclically write data obtained from the database to 5 dl

Source: Internet
Author: User
How to write the data obtained from the database to 5 dl cyclically after the first loop is completed, and then return to the first dl to append data to it. ------ Solution -------------------- & lt ;? Php $ arrarray (0 & gt; array (name & gt; James, job & gt; php programmer,), 1 & gt; how does arr write the data obtained from the database into 5 dl cycles?
After completing the first loop, return to the first dl to append data to it.

------ Solution --------------------
// Such as the data obtained by the database
$ Arr = array (
0 => array (
'Name' => 'Zhang San ',
'Job' => 'php programmer ',
),
1 => array (
'Name' => 'Li Si ',
'Job' => 'web designer ',
),
2 => array (
'Name' => 'Wang 5 ',
'Job' => 'web development engineer ',
),
);

$ Dlstr = '';
Foreach ($ arr as $ k => $ v)
{
$ Dlstr. ="
{$ V ['name']}, {$ v ['job']}
";
}

Echo $ dlstr;
?>

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.