- implode: documentation ( source)
- explode: documentation ( source)
- array_unique: documentation ( source)
<?php
$s = '23610
21601
23294
22256
21940
24164
22276
21441
21711
24115
24114
21712
20966
24167
24165
23786
21941
23525
21433
21440
24166
21974
23963
23597
23798
23952
24116
24089
20990
21710
21257
24096
22507
20933
20981
20932
20988
21459
21437
21199
20949
21837
20968
21745
21703
21434
21790
40569
30135
48284
39877
36087
45312
27162
38981
28722
30130
31946';
$a = array_unique(explode("\n", $s));
echo '(' . implode("'), ('", $a) . ')';