Я хочу получить вывод первого массива во второй массив с помощью функции php или php class-Здесь я должен включить это -
- "ключ" значение гастронома "|"является разделителем значения ключа "name".
- Если значение ключа "attr" '32' в массиве, то этот массив имеет дочерние элементы и добавляет дочерние элементы в "title".
$Y=array(array('name' => "Family1",'attr' => array(64,8),'deli' => "|"),array('name' => "Family2",'attr' => array(32,8),'deli' => "|"),array('name' => "Family2|Parents1",'attr' => array(64,8),'deli' => "|"),array('name' => "Family2|Parents3",'attr' => array(32,8),'deli' => "|"),array('name' => "Family2|Parents3|Children",'attr' => array(32,8),'deli' => "|"),array('name' => "Family2|Parents3|Children|ChildOfChild",'attr' => array(64,8),'deli' => "|"),array('name' => "Family4",'attr' => array(32,8),'deli' => "|"),array('name' => "Family4|Child",'attr' => array(64,8),'deli' => "|"));
$Y2=array(array('name' => "Family1",'title' => "Family1",'attr' => array(64,8),'deli' => "|"),array('name' => "Family2",'title' => "Family2",'attr' => array(32,8),'deli' => "|",'child' => array('name' => "Family2|Parents1",'title' => "Parents1",'attr' => array(64,8),'deli' => "|"),array('name' => "Family2|Parents3",'title' => "Parents3",'attr' => array(32,8),'deli' => "|",'child' => array('name' => "Family2|Parents3|Children",'title' => "Children",'attr' => array(32,8),'deli' => "|",'child' => array('name' => "Family2|Parents3|Children|ChildOfChild",'title' => "ChildOfChild",'attr' => array(64,8),'deli' => "|")))),array('name' => "Family3",'title' => "Family3",'attr' => array(64,8),'deli' => "|"),array('name' => "Family4",'title' => "Family4",'attr' => array(32,8),'deli' => "|",'child' => array('name' => "Family4|Child",'title' => "Child",'attr' => array(64,8),'deli' => "|")));