This question already has an answer here:
- PHP - How to merge arrays inside array 4 answers
- How to Flatten a Multidimensional Array? 27 answers
I have some author names of different books as listed below. some of has one author name some has two and three and so on. This is my array: (PHP, Laravel)
array:10 [▼
0 => "["Yashavant P. Kanetkar"]"
1 => "["Jordan Krause"]"
2 => "["Christopher Negus","James","McKnight"]"
3 => "["Richard Petersen"]"
4 => "["Das", "Sumitabha"]"
5 => "["Groff", "James"]"
6 => "["Martin Reddy"]"
]
And I want to convert to this:
array:10 [▼
0 => "["Yashavant P. Kanetkar"]"
1 => "["Jordan Krause"]"
2 => "["Christopher Negus"]"
3 => "["James"]"
4 => "["McKnight"]"
5 => "["Richard Petersen"]"
6 => "["Das"]"
7 => "["Sumitabha"]"
8 => "["Groff"]"
9 => "["James"]"
10 => "["Martin Reddy"]"
]
</div>