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 the data to it ., & Lt ;? Php // for example, database data $ arr = array (0 = & gt; array ('name' = & gt; 'Zhang San', 'job' = & gt; 'php programmer ',), 1 = & gt; array ('n how to cyclically write data obtained from the database into five dl
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;
?>