数据结构;[data:private] => Array
(
[id] => Array
(
[0] => 269061
[1] => 269376
) [issuetime] => 2011年09月
[PpjID] => 14262
[corpid] => Array
(
[0] => 379984,269061
[1] => 233241,269376
[2] => 690894,270702
[3] => 694397,278090
) )要的结果;
array
(
[0] => 379984
[1] => 233241
)
解决方案 »
- 一段写法报错
- magic_quotes_gpc问题
- windows server 2003里运行项目
- 急啊,能不能直接把一个数组,session
- 求免费MySQL空间
- php与web服务,欢迎讨论。
- 怎样获得所有提交过来的参数
- 如何深入学习php? 我只看不练,看了好多书和代码,但实践的不好?时间就是钱哪?
- ASP里的Response.Redirect,PHP里怎么写
- 就是需要用php把别的网站上的验证码放到自己的网页上,只需要图片,不需要验证码,用户看到图片后手动输入验证 能实现登陆
- excel_class 导入导出的扩展
- 初级问题:php可否调用普通dll,可否执行带界面的window程序
(
'id' => Array
(
0 => '269061',
1 => '269376'
)
,
'issuetime' => '2011年09月',
'PpjID' => '14262',
'corpid' => Array
(
0 => '379984,269061',
1 => '233241,269376',
2 => '690894,270702',
3 => '694397,278090'
)
);$ar = array();
foreach($data['corpid'] as $v) {
$tmp = explode(',', $v);
$ar[$tmp[1]] = $tmp[0];
}
$result = array();
foreach($data['id'] as $v) $result[] = $ar[$v];
print_r($result);
$array = array(
'id' => array(269061,269376),
'corpid' => array('379984,269061','233241,269376', '690894,270702', '694397,278090')
);
$pattern = '(' . implode('|', $array['id']) . ')';
foreach($array['corpid'] as $row) {
if(preg_match("/(\d+),$pattern/", $row, $matches)) {
echo $matches[1] . '<br/>';
}
}
/**
输出结果:
379984
233241
*/