0
My db-Tabelle ist:php, wie Werte in Array zu duplizieren (mehrdimensionale)
author book repeat
------ ---- ------
Paulo Coelho the alchemist 2
Adam Smith The Wealth of Nations 1
Ich hole Daten von db mit dem folgenden PHP-Code:
...
$books_array[]= array(
'author'=> $row['author'],
'book'=> $row['book'],
);
Aber ich weiß nicht, wie um die Werte gemäß meinem Wiederholungswert zu wiederholen. Wie kann ich das folgende Array erhalten?
array
[0] => Array
(
[author] => Coelho
[book] => The Alchemist
)
[1] => Array
(
[author] => Coelho
[book] => The Alchemist
)
[2] => Array
(
[author] => Smith
[book] => The Wealth of Nations
)
Vielen Dank!