Skip to content
Advertisement

Tag: compare

How to get intersection between two strings in PHP

A problem description: I have two strings and I need to find the length of intersection of them. Let’s assume the both strings are Latin-ASCII and lower case. These are expected results: My try to solve the problem: I’ve tried to compare the strings using array_intersect() function this way: But this way of comparing two strings is inappropriate because it

Advertisement