First of all thanks to Dave Chen for helping me with the merger.
Now I ran into a problem. When I merge using this code:
$string1 = "
;1
2
3
;4
";
$string2 = "
;1
;2
;3
;4
;5
;6
";
echo implode("\r\n",array_unique(array_merge(explode("\r\n",$string1),explode("\r\n",$string2))));
The output is ;1 2 3 ;4 ;2 ;3 ;5 ;6 but I need it to be ;1 2 3 ;4 ;5 ;6