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;
?>