In my project a file contains content like
&lbl1=Mount Olympus - 24\" long x 48\" wide - Oil on canvas&prc1=725&sold1=&
&lbl2=Edgartown Mar
The parse_str function is what you're after.
Alternatively, you could iterate like so:
$labels = array();
foreach (explode('&', $newLine) as $item) {
list($name, $value) = explode('=', $item);
$labels[$name] = $value;
}
Now you have an indexed array of labels. If you want all of the values as a string, try
implode(', ', $labels);
Good luck!