I have two arrays:
$role = isset($_POST['role'])?$_POST['role']:'';
$details = isset($_POST['details'])?$_POST['details']:'';
Output for arrays is:
Role: Array ( [0] => leader [1] => follower )
Details: Array ( [0] => lead [1] => follow )
I want to assign leader to lead and follower to follow. Then I put two arrays into one:
foreach( $role as $rl => $r )
{
$array_test3[] = array($r, $details[$rl]);
}
Output for print_r($array_test3) is:
Array ( [0] => Array ( [0] => leader [1] => lead ) [1] => Array ( [0] => follower [1] => follow ) )
Then I tried to implode an array:
$test3 = implode('<|>',array_map('implode',$array_test3));
Output for echo $test3.'<br/>'; is:
leaderlead<|>followerfollow
But I want is to get the following:
leader<|>lead<|>follower<|>follow
How can I do this?