- var_export: documentation ( source)
- explode: documentation ( source)
<?php
$str = '{xxx} some text 1{*|, some text 2 {xxx}}{*|, some text 3 {xxx}}{*|, 1 {xxx} some text 4}{*|, 1 {xxx} some text 5}';
$values = explode('{*|,', $str);
$newArray = [];
for ($i = 1; $i < count($values); $i++) {
$newArray[$values[0]][$i - 1] = $values[$i];
}
var_export($newArray);