<?php
$s = 'string|name1,value1|name2,value2|name3,value3';
$b = array();
foreach( explode('|', $s) AS $e ) {
list($k, $v) = explode(',', $e);
$b[$k] = $v;
}
?>
$b: Array
(
[string] =>
[name1] => value1
[name2] => value2
[name3] => value3
)