i need help for Below Array:
$inputarray = array(
array("id" => 2,"name" => "ProductName","comment" => "best product comment 1"),
array("id" => 2,"name" => "ProductName","comment" => "best product comment 2"),
array("id" => 2,"name" => "ProductName","comment" => "best product comment 3")
);
output should be:
$outputarray = array(
array("id" => 2,"name" => "ProductName","comment" => array("best product comment 1","best product comment 2","best product comment 3"))
);
i need this "comment" key of value array in return
array_unique
is not working in it. it gives me unique but not that comments array. it's only give me last value of comment key value like below
$outputarray = array(
array("id" => 2,"name" => "ProductName","comment" => "best product comment 3")
);
please help me out.