About character intersection methods
There are currently 2 strings
"A B C"
"D E F"
Judging the total character of the string whether there is a intersection, I wrote a method, I feel a bit complicated, is the character to the array comparison, there is no direct comparison of the function? Second, the characters are separated by a space, if there is no space, there is no faster way to convert the string into an array.
$str _a= "a B C";
$str _b= "D E F";
$R =array_intersect (Explode ("", $str _a), Explode ("", $str _b));
echo!empty ($R)? " There is intersection ":" No intersection ";
------Solution--------------------
The space is also the character, why not count?
When there is no space
$str _a = "ABC";
$str _b = "DEF";
Echo (Similar_text ($str _a, $str _b)? ' Have ': ' None '). ' Intersection '; No intersection
$str _a = "ABC";
$str _b = "DEB";
Echo (Similar_text ($str _a, $str _b)? ' Have ': ' None '). ' Intersection '; have intersection