【发布时间】:2012-06-01 21:29:13
【问题描述】:
我正在使用$front->getRequest()->getParams() 来获取 url 参数。它们看起来像这样
Zend_Debug::dump($front->getRequest()->getParams());
array(4) {
["id"] => string(7) "3532231"
["module"] => string(7) "test"
["controller"] => string(6) "index"
["action"] => string(5) "index"
}
我有兴趣通过preg_match_all 运行此程序,以便通过使用类似于([\s0-9])+ 的一些正则表达式仅返回 id 号
由于某种原因,我无法隔离该号码。
数组中可能会有更多类似id 的值,但preg_match_all 应该在新数组中将它们返回给我
有什么想法吗?
谢谢
【问题讨论】:
标签: php arrays numbers preg-match-all