Given an array with n values, for example:
$arr[] = \'ABCDEFABC\';
$arr[] = \'ABCDEFDEF\';
$arr[] = \'ABCDEFGHI\';
$arr[] = \'ABCDEFJKL\';
how
I've come up with a solution for my first problem:
EDIT: BUGGY!
$arr = array();
// Bug: ABCDEFX
$arr[] = 'ABCDEFAXC';
$arr[] = 'ABCDEFDXF';
$arr[] = 'ABCDEFGXI';
$arr[] = 'ABCDEFJXL';
/*
$arr[] = 'ABCDEFABC';
$arr[] = 'ABCDEFDEF';
$arr[] = 'ABCDEFGHI';
$arr[] = 'ABCDEFJKL';
*/
// ABCDEF
$result = implode('', call_user_func_array('array_intersect_assoc', array_map('str_split', $arr)));
One left to go now...