$allProfiles = '';
foreach( array_merge( $profile, $otherProfiles ) as $all ):
$allProfiles .= $all;
endforeach;
echo "Player all profiles: $allProfiles";
This prints for me Player all profiles: NameNameNameNameName
, how can I implode by comma? When I make $allProfiles .= implode(",", $all)
; Then I got Invalid arguments passed in
Thanks in advance
EDIT
Just changed $allProfiles .= $all;
to $allProfiles[] = $all;
Then in echo used implode
..
Make array like this
$allProfiles = array();
foreach( array_merge( $profile, $otherProfiles ) as $all ):
$allProfiles[]= $all;
endforeach;
echo "Player all profiles: ".implode(",",$allProfiles);