Home  >  Article  >  Backend Development  >  多个字符串找到不同点

多个字符串找到不同点

WBOY
WBOYOriginal
2016-06-13 13:10:43998browse

多个字符串找出不同点
假如我有如下字符串
(
  [0] => http://news.qq.com/newsgn/zhxw/shizhengxinwen_2.htm
  [1] => http://news.qq.com/newsgn/zhxw/shizhengxinwen_3.htm
  [2] => http://news.qq.com/newsgn/zhxw/shizhengxinwen_4.htm
  [3] => http://news.qq.com/newsgn/zhxw/shizhengxinwen_5.htm
  [4] => http://news.qq.com/newsgn/zhxw/shizhengxinwen_80.htm
)

有什么好的算法可以得到他们的不同点,用(*)替代?
比如以上网址可以归纳为

http://news.qq.com/newsgn/zhxw/shizhengxinwen_(*).htm

------解决方案--------------------
算法需要建立在每组字符串都有某种相同的规律。
如果是 array('hello', 'hellp', 'world'); 怎么表示? (*)(*)(*)(*)(*) ?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn