Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 在 PHP 中突出显示两个字符串之间的差异
例如,我有这些字符串:
示例XY2 \r\n(系统 x)
和
别的东西XY2
如您所见,只有 XY2 是相同的。检查 2 个字符串是否有共同点(如 XY2)的最佳方法是什么?
谢谢!
您可以尝试使用similar_text功能。不要安静你需要的东西,但可以提供帮助。
similar_text
查看有关查找最大公共子字符串的帖子。