很抱歉的冗余,我问过这在我以前的问题在这里:What's the regex to solve this problem?Regex修复此问题? [延伸]
这个问题是一个扩展:
从元件在以下的数组:
http://example.com/apps/1235554/
http://example.com/apps/apple/
http://example.com/apps/126734
http://example.com/images/a.jpg
我分离出apps/{number}/
和apps/{number}
使用:
foreach ($urls as $url)
{
if (preg_match('~apps/[0-9]+(/|$)~', $url)) echo $url;
}
现在,我怎样才能将{number}
推到另一个具有相同正则表达式的数组?
按预期工作..谢谢! – Yeti 2010-06-17 13:16:09