【发布时间】:2018-03-08 15:09:26
【问题描述】:
我有两个字符串
$old_string = "a,b,c,d,";
$new_string 通过 post 方法从表单中获取。
$new_string = "c,d,e,f,";
从上面的 2 个字符串中获取公共子字符串的最佳方法是什么?
$common_string ="a,b,c,d,e,f,";
以及如何表明从 $new_string 中删除了 c 和 d?
非常感谢
【问题讨论】:
-
Stack Overflow 您应该尝试自己编写代码。在 doing more research 之后,如果您有问题,您可以发布您尝试过的内容,并清楚地解释什么不起作用并提供Minimal, Complete, and Verifiable example。我建议阅读How to Ask 一个好问题和the perfect question。另外,请务必使用tour 并阅读this。
标签: php duplicates substring string-comparison