I have file with datas. Every line has name of author/authors..it looks like this:
"Giacometti, Jasminka"; "Mazor Jolic, Slavica"; "Josic, Djuro";
"Hoffmeister, Karin M"; "Grozovsky, Renata"; "Jurak Begonja, Antonija"; "Hartwig, John H";
"Jakopovic, Boris"; "Kraljevic Pavelic, Sandra"; "BelScak-Cvitanovic, Ana"; "Harej, Anja"; "Jakopovich, Ivan";
For example, for the first row:
"Giacometti, Jasminka"; "Mazor Jolic, Slavica"; "Josic, Djuro";
I need to get this and write it in another file:
"Giacometti, Jasminka"; "Mazor Jolic, Slavica";1
"Giacometti, Jasminka"; "Josic, Djuro";1
"Mazor Jolic, Slavica"; "Josic, Djuro";1
How can I do it in php? I tried with getting every line in the array, but then I don't know how to split datas from that row.
$handle = @fopen("datas.txt", "r");
$listA = array();
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
$listA[] = $buffer;
}
Thank you.